Code cleanup: Add objfile_name accessor
[deliverable/binutils-gdb.git] / gdb / probe.c
index 4d8b92b541ba6d5b6192d1ca0b54955e66c29c68..4046701447facbcdaee81492833bc9c1e2e8148f 100644 (file)
@@ -116,8 +116,9 @@ parse_probes (char **argptr, struct linespec_result *canonical)
          continue;
 
        if (objfile_namestr
-           && FILENAME_CMP (objfile->name, objfile_namestr) != 0
-           && FILENAME_CMP (lbasename (objfile->name), objfile_namestr) != 0)
+           && FILENAME_CMP (objfile_name (objfile), objfile_namestr) != 0
+           && FILENAME_CMP (lbasename (objfile_name (objfile)),
+                            objfile_namestr) != 0)
          continue;
 
        probes = objfile->sf->sym_probe_fns->sym_get_probes (objfile);
@@ -263,7 +264,7 @@ collect_probes (char *objname, char *provider, char *probe_name,
 
       if (objname)
        {
-         if (regexec (&obj_pat, objfile->name, 0, NULL, 0) != 0)
+         if (regexec (&obj_pat, objfile_name (objfile), 0, NULL, 0) != 0)
            continue;
        }
 
@@ -313,7 +314,7 @@ compare_probes (const void *a, const void *b)
   if (pa->address > pb->address)
     return 1;
 
-  return strcmp (pa->objfile->name, pb->objfile->name);
+  return strcmp (objfile_name (pa->objfile), objfile_name (pb->objfile));
 }
 
 /* Helper function that generate entries in the ui_out table being
@@ -538,7 +539,7 @@ info_probes_for_ops (char *arg, int from_tty, const struct probe_ops *pops)
     {
       size_name = max (strlen (probe->name), size_name);
       size_provider = max (strlen (probe->provider), size_provider);
-      size_objname = max (strlen (probe->objfile->name), size_objname);
+      size_objname = max (strlen (objfile_name (probe->objfile)), size_objname);
     }
 
   ui_out_table_header (current_uiout, size_provider, ui_left, "provider",
@@ -588,7 +589,8 @@ info_probes_for_ops (char *arg, int from_tty, const struct probe_ops *pops)
       else
        print_ui_out_info (probe);
 
-      ui_out_field_string (current_uiout, "object", probe->objfile->name);
+      ui_out_field_string (current_uiout, "object",
+                          objfile_name (probe->objfile));
       ui_out_text (current_uiout, "\n");
 
       do_cleanups (inner);
This page took 0.035563 seconds and 4 git commands to generate.