mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 06:45:56 +08:00
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:
@ -166,7 +166,6 @@ partial_map_symtabs_matching_filename (struct objfile *objfile,
|
||||
{
|
||||
struct partial_symtab *pst;
|
||||
const char *name_basename = lbasename (name);
|
||||
int is_abs = IS_ABSOLUTE_PATH (name);
|
||||
|
||||
ALL_OBJFILE_PSYMTABS_REQUIRED (objfile, pst)
|
||||
{
|
||||
@ -179,8 +178,7 @@ partial_map_symtabs_matching_filename (struct objfile *objfile,
|
||||
if (pst->anonymous)
|
||||
continue;
|
||||
|
||||
if (FILENAME_CMP (name, pst->filename) == 0
|
||||
|| (!is_abs && compare_filenames_for_search (pst->filename, name)))
|
||||
if (compare_filenames_for_search (pst->filename, name))
|
||||
{
|
||||
if (partial_map_expand_apply (objfile, name, real_path,
|
||||
pst, callback, data))
|
||||
@ -197,10 +195,11 @@ partial_map_symtabs_matching_filename (struct objfile *objfile,
|
||||
this symtab and use its absolute path. */
|
||||
if (real_path != NULL)
|
||||
{
|
||||
gdb_assert (IS_ABSOLUTE_PATH (real_path));
|
||||
gdb_assert (IS_ABSOLUTE_PATH (name));
|
||||
psymtab_to_fullname (pst);
|
||||
if (pst->fullname != NULL
|
||||
&& (FILENAME_CMP (real_path, pst->fullname) == 0
|
||||
|| (!is_abs && compare_filenames_for_search (real_path, name))))
|
||||
&& FILENAME_CMP (real_path, pst->fullname) == 0)
|
||||
{
|
||||
if (partial_map_expand_apply (objfile, name, real_path,
|
||||
pst, callback, data))
|
||||
|
Reference in New Issue
Block a user