aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.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/breakpoint.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/breakpoint.c')
-rw-r--r--gdb/breakpoint.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index e9d29ff..f6a0276 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -10070,6 +10070,8 @@ clear_command (char *arg, int from_tty)
make_cleanup (VEC_cleanup (breakpoint_p), &found);
for (i = 0; i < sals.nelts; i++)
{
+ int is_abs, sal_name_len;
+
/* 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
@@ -10083,6 +10085,8 @@ 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);
+ sal_name_len = is_abs ? 0 : strlen (sal.symtab->filename);
/* Find all matching breakpoints and add them to 'found'. */
ALL_BREAKPOINTS (b)
@@ -10102,13 +10106,24 @@ clear_command (char *arg, int from_tty)
&& (loc->address == sal.pc)
&& (!section_is_overlay (loc->section)
|| loc->section == sal.section));
- int line_match = ((default_match || sal.explicit_line)
- && loc->source_file != NULL
- && sal.symtab != NULL
- && sal.pspace == loc->pspace
- && filename_cmp (loc->source_file,
- sal.symtab->filename) == 0
- && loc->line_number == sal.line);
+ int line_match = 0;
+
+ if ((default_match || sal.explicit_line)
+ && loc->source_file != NULL
+ && sal.symtab != NULL
+ && sal.pspace == loc->pspace
+ && loc->line_number == sal.line)
+ {
+ if (filename_cmp (loc->source_file,
+ sal.symtab->filename) == 0)
+ line_match = 1;
+ else if (!IS_ABSOLUTE_PATH (sal.symtab->filename)
+ && compare_filenames_for_search (loc->source_file,
+ sal.symtab->filename,
+ sal_name_len))
+ line_match = 1;
+ }
+
if (pc_match || line_match)
{
match = 1;