gdb/
[external/binutils.git] / gdb / breakpoint.c
index 55274c8..026ce73 100644 (file)
@@ -5707,9 +5707,10 @@ print_breakpoint_location (struct breakpoint *b,
          ui_out_wrap_hint (uiout, wrap_indent_at_field (uiout, "what"));
          ui_out_text (uiout, "at ");
        }
-      ui_out_field_string (uiout, "file", loc->symtab->filename);
+      ui_out_field_string (uiout, "file",
+                          symtab_to_filename_for_display (loc->symtab));
       ui_out_text (uiout, ":");
-      
+
       if (ui_out_is_mi_like_p (uiout))
        ui_out_field_string (uiout, "fullname",
                             symtab_to_fullname (loc->symtab));
@@ -9770,7 +9771,7 @@ resolve_sal_pc (struct symtab_and_line *sal)
     {
       if (!find_line_pc (sal->symtab, sal->line, &pc))
        error (_("No line %d in file \"%s\"."),
-              sal->line, sal->symtab->filename);
+              sal->line, symtab_to_filename_for_display (sal->symtab));
       sal->pc = pc;
 
       /* If this SAL corresponds to a breakpoint inserted using a line
@@ -11941,6 +11942,8 @@ clear_command (char *arg, int from_tty)
   make_cleanup (VEC_cleanup (breakpoint_p), &found);
   for (i = 0; i < sals.nelts; i++)
     {
+      const char *sal_fullname;
+
       /* 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
@@ -11954,6 +11957,8 @@ clear_command (char *arg, int from_tty)
          1              0             <can't happen> */
 
       sal = sals.sals[i];
+      sal_fullname = (sal.symtab == NULL
+                     ? NULL : symtab_to_fullname (sal.symtab));
 
       /* Find all matching breakpoints and add them to 'found'.  */
       ALL_BREAKPOINTS (b)
@@ -11977,14 +11982,12 @@ clear_command (char *arg, int from_tty)
 
                  if ((default_match || sal.explicit_line)
                      && loc->symtab != NULL
-                     && sal.symtab != NULL
+                     && sal_fullname != NULL
                      && sal.pspace == loc->pspace
-                     && loc->line_number == sal.line)
-                   {
-                     if (compare_filenames_for_search (loc->symtab->filename,
-                                                       sal.symtab->filename))
-                       line_match = 1;
-                   }
+                     && loc->line_number == sal.line
+                     && filename_cmp (symtab_to_fullname (loc->symtab),
+                                      sal_fullname) == 0)
+                   line_match = 1;
 
                  if (pc_match || line_match)
                    {
@@ -12726,7 +12729,8 @@ say_where (struct breakpoint *b)
             more nicely.  */
          if (b->loc->next == NULL)
            printf_filtered (": file %s, line %d.",
-                            b->loc->symtab->filename, b->loc->line_number);
+                            symtab_to_filename_for_display (b->loc->symtab),
+                            b->loc->line_number);
          else
            /* This is not ideal, but each location may have a
               different file name, and this at least reflects the
@@ -13925,7 +13929,8 @@ update_static_tracepoint (struct breakpoint *b, struct symtab_and_line sal)
                                   SYMBOL_PRINT_NAME (sym));
              ui_out_text (uiout, " at ");
            }
-         ui_out_field_string (uiout, "file", sal2.symtab->filename);
+         ui_out_field_string (uiout, "file",
+                              symtab_to_filename_for_display (sal2.symtab));
          ui_out_text (uiout, ":");
 
          if (ui_out_is_mi_like_p (uiout))
@@ -13943,7 +13948,7 @@ update_static_tracepoint (struct breakpoint *b, struct symtab_and_line sal)
 
          xfree (b->addr_string);
          b->addr_string = xstrprintf ("%s:%d",
-                                      sal2.symtab->filename,
+                                  symtab_to_filename_for_display (sal2.symtab),
                                       b->loc->line_number);
 
          /* Might be nice to check if function changed, and warn if