summaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2013-02-03 16:00:34 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2013-02-03 16:00:34 +0000
commited4d9dacb69f998899d48d8d9678de87938da7d8 (patch)
tree78c6bfa6b2755787d1dbfa0827e992feb232cfe0 /gdb/breakpoint.c
parente6b3eacaca03f328175064c698a4542e96a63df7 (diff)
downloadgdb-ed4d9dacb69f998899d48d8d9678de87938da7d8.tar.gz
gdb/
Code cleanup. * breakpoint.c (clear_command): Remove variable is_abs, unify the call of filename_cmp with compare_filenames_for_search. * dwarf2read.c (dw2_map_symtabs_matching_filename): Remove variable is_abs, unify the call of FILENAME_CMP with compare_filenames_for_search. New gdb_asserts for real_path and name. Unify the call of compare_filenames_for_search with FILENAME_CMP. * psymtab.c (partial_map_symtabs_matching_filename): Likewise. * symfile.h (struct quick_symbol_functions): Extend the comment for map_symtabs_matching_filename. * symtab.c (compare_filenames_for_search): Remove the function comment relative path requirement. Handle absolute filenames, with a comment. (iterate_over_some_symtabs): Remove variable is_abs, unify the call of FILENAME_CMP with compare_filenames_for_search. New gdb_asserts for real_path and name. Unify the call of compare_filenames_for_search with FILENAME_CMP. (iterate_over_symtabs): New gdb_assert on REAL_PATH. gdb/testsuite/ * gdb.mi/mi-fullname-deleted.exp: Use double last slash for $srcfileabs. (compare_filenames_for_search does not match) (compare_filenames_for_search does match): New tests.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 847b66c2d48..55274c88f67 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -11941,8 +11941,6 @@ clear_command (char *arg, int from_tty)
make_cleanup (VEC_cleanup (breakpoint_p), &found);
for (i = 0; i < sals.nelts; i++)
{
- int is_abs;
-
/* If exact pc given, clear bpts at that pc.
If line given (pc == 0), clear all bpts on specified line.
If defaulting, clear all bpts on default line
@@ -11956,7 +11954,6 @@ clear_command (char *arg, int from_tty)
1 0 <can't happen> */
sal = sals.sals[i];
- is_abs = sal.symtab == NULL ? 1 : IS_ABSOLUTE_PATH (sal.symtab->filename);
/* Find all matching breakpoints and add them to 'found'. */
ALL_BREAKPOINTS (b)
@@ -11984,12 +11981,8 @@ clear_command (char *arg, int from_tty)
&& sal.pspace == loc->pspace
&& loc->line_number == sal.line)
{
- if (filename_cmp (loc->symtab->filename,
- sal.symtab->filename) == 0)
- line_match = 1;
- else if (!IS_ABSOLUTE_PATH (sal.symtab->filename)
- && compare_filenames_for_search (loc->symtab->filename,
- sal.symtab->filename))
+ if (compare_filenames_for_search (loc->symtab->filename,
+ sal.symtab->filename))
line_match = 1;
}