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.
This commit is contained in:
parent
2f202fde0a
commit
af529f8f61
8 changed files with 68 additions and 42 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue