Code cleanup: Add objfile_name accessor
[deliverable/binutils-gdb.git] / gdb / target.c
index d55712d4c1c4ac7a41e3a4f9971e9d69b9752c62..5ab328c192b0563cc2f053a217c1f865916db6cf 100644 (file)
@@ -1187,10 +1187,10 @@ target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset)
            case TLS_LOAD_MODULE_NOT_FOUND_ERROR:
              if (objfile_is_library)
                error (_("Cannot find shared library `%s' in dynamic"
-                        " linker's load module list"), objfile->name);
+                        " linker's load module list"), objfile_name (objfile));
              else
                error (_("Cannot find executable file `%s' in dynamic"
-                        " linker's load module list"), objfile->name);
+                        " linker's load module list"), objfile_name (objfile));
              break;
            case TLS_NOT_ALLOCATED_YET_ERROR:
              if (objfile_is_library)
@@ -1198,25 +1198,25 @@ target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset)
                         " thread-local variables in\n"
                         "the shared library `%s'\n"
                         "for %s"),
-                      objfile->name, target_pid_to_str (ptid));
+                      objfile_name (objfile), target_pid_to_str (ptid));
              else
                error (_("The inferior has not yet allocated storage for"
                         " thread-local variables in\n"
                         "the executable `%s'\n"
                         "for %s"),
-                      objfile->name, target_pid_to_str (ptid));
+                      objfile_name (objfile), target_pid_to_str (ptid));
              break;
            case TLS_GENERIC_ERROR:
              if (objfile_is_library)
                error (_("Cannot find thread-local storage for %s, "
                         "shared library %s:\n%s"),
                       target_pid_to_str (ptid),
-                      objfile->name, ex.message);
+                      objfile_name (objfile), ex.message);
              else
                error (_("Cannot find thread-local storage for %s, "
                         "executable file %s:\n%s"),
                       target_pid_to_str (ptid),
-                      objfile->name, ex.message);
+                      objfile_name (objfile), ex.message);
              break;
            default:
              throw_exception (ex);
@@ -2491,7 +2491,8 @@ target_info (char *args, int from_tty)
   int has_all_mem = 0;
 
   if (symfile_objfile != NULL)
-    printf_unfiltered (_("Symbols from \"%s\".\n"), symfile_objfile->name);
+    printf_unfiltered (_("Symbols from \"%s\".\n"),
+                      objfile_name (symfile_objfile));
 
   for (t = target_stack; t != NULL; t = t->beneath)
     {
This page took 0.029217 seconds and 4 git commands to generate.