aboutsummaryrefslogtreecommitdiff
path: root/gdb/psymtab.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-01-16 20:40:53 +0000
committerTom Tromey <tromey@redhat.com>2012-01-16 20:40:53 +0000
commit4aac40c83727ce9e8ec9d6968d589df0939c9827 (patch)
tree6dd54fa985311dd9b7d78ed28315dac7f1ffdf7e /gdb/psymtab.c
parentcafec441901459c36ad92f1cd9eef648534ea53b (diff)
downloadgdb-4aac40c83727ce9e8ec9d6968d589df0939c9827.zip
gdb-4aac40c83727ce9e8ec9d6968d589df0939c9827.tar.gz
gdb-4aac40c83727ce9e8ec9d6968d589df0939c9827.tar.bz2
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 1f9457f..998bc05 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;
}