summaryrefslogtreecommitdiff
path: root/gdb/psymtab.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-01-16 20:40:47 +0000
committerTom Tromey <tromey@redhat.com>2012-01-16 20:40:47 +0000
commit024e0e8b29c57131c65424b31e931e6f8f511248 (patch)
tree83e423e4a9dc457087a4a1a83e9fcbb292055d3f /gdb/psymtab.c
parenteb28de4a09f016d3de7caccec781eb70995a4001 (diff)
downloadgdb-024e0e8b29c57131c65424b31e931e6f8f511248.tar.gz
gdb
* NEWS: Add item. * symtab.h (compare_filenames_for_search): Declare. * symtab.c (compare_filenames_for_search): New function. (iterate_over_some_symtabs): Use it. * symfile.h (struct quick_symbol_functions) <map_symtabs_matching_filename>: Change spec. * psymtab.c (partial_map_symtabs_matching_filename): Use compare_filenames_for_search. Update for new spec. * dwarf2read.c (dw2_map_symtabs_matching_filename): Use compare_filenames_for_search. Update for new spec. * breakpoint.c (clear_command): Use compare_filenames_for_search. gdb/doc * gdb.texinfo (Specify Location): Document relative file name handling. gdb/testsuite * gdb.linespec/linespec.exp: Change some tests to use $decimal. Add tests for relative directory.
Diffstat (limited to 'gdb/psymtab.c')
-rw-r--r--gdb/psymtab.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index 1f9457f7e3b..998bc05b730 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -164,10 +164,14 @@ partial_map_symtabs_matching_filename (struct objfile *objfile,
{
struct partial_symtab *pst;
const char *name_basename = lbasename (name);
+ int name_len = strlen (name);
+ int is_abs = IS_ABSOLUTE_PATH (name);
ALL_OBJFILE_PSYMTABS_REQUIRED (objfile, pst)
{
- if (FILENAME_CMP (name, pst->filename) == 0)
+ if (FILENAME_CMP (name, pst->filename) == 0
+ || (!is_abs && compare_filenames_for_search (pst->filename,
+ name, name_len)))
{
if (partial_map_expand_apply (objfile, name, full_path, real_path,
pst, callback, data))
@@ -186,7 +190,9 @@ partial_map_symtabs_matching_filename (struct objfile *objfile,
{
psymtab_to_fullname (pst);
if (pst->fullname != NULL
- && FILENAME_CMP (full_path, pst->fullname) == 0)
+ && (FILENAME_CMP (full_path, pst->fullname) == 0
+ || (!is_abs && compare_filenames_for_search (pst->fullname,
+ name, name_len))))
{
if (partial_map_expand_apply (objfile, name, full_path, real_path,
pst, callback, data))
@@ -203,7 +209,10 @@ partial_map_symtabs_matching_filename (struct objfile *objfile,
rp = gdb_realpath (pst->fullname);
make_cleanup (xfree, rp);
}
- if (rp != NULL && FILENAME_CMP (real_path, rp) == 0)
+ if (rp != NULL
+ && (FILENAME_CMP (real_path, rp) == 0
+ || (!is_abs && compare_filenames_for_search (real_path,
+ name, name_len))))
{
if (partial_map_expand_apply (objfile, name, full_path, real_path,
pst, callback, data))
@@ -212,17 +221,6 @@ partial_map_symtabs_matching_filename (struct objfile *objfile,
}
}
- /* Now, search for a matching tail (only if name doesn't have any dirs). */
-
- if (name_basename == name)
- ALL_OBJFILE_PSYMTABS_REQUIRED (objfile, pst)
- {
- if (FILENAME_CMP (lbasename (pst->filename), name) == 0)
- if (partial_map_expand_apply (objfile, name, full_path, real_path, pst,
- callback, data))
- return 1;
- }
-
return 0;
}