Uniquefy gdb.threads/attach-into-signal.exp
[deliverable/binutils-gdb.git] / gdb / objfiles.c
index a5df30597c3a715aa75289a362630403976aa57b..c6f9f001a3c687658b711eb751344e2f22719996 100644 (file)
@@ -1,6 +1,6 @@
 /* GDB routines for manipulating objfiles.
 
-   Copyright (C) 1992-2014 Free Software Foundation, Inc.
+   Copyright (C) 1992-2015 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support, using pieces from other GDB modules.
 
@@ -301,7 +301,8 @@ allocate_objfile (bfd *abfd, const char *name, int flags)
       gdb_assert ((flags & OBJF_NOT_FILENAME) != 0);
       expanded_name = xstrdup ("<<anonymous objfile>>");
     }
-  else if ((flags & OBJF_NOT_FILENAME) != 0)
+  else if ((flags & OBJF_NOT_FILENAME) != 0
+          || is_target_filename (name))
     expanded_name = xstrdup (name);
   else
     expanded_name = gdb_abspath (name);
@@ -1492,7 +1493,7 @@ default_iterate_over_objfiles_in_search_order
     }
 }
 
-/* Return canonical name for OBJFILE.  */
+/* See objfiles.h.  */
 
 const char *
 objfile_name (const struct objfile *objfile)
@@ -1503,6 +1504,25 @@ objfile_name (const struct objfile *objfile)
   return objfile->original_name;
 }
 
+/* See objfiles.h.  */
+
+const char *
+objfile_filename (const struct objfile *objfile)
+{
+  if (objfile->obfd != NULL)
+    return bfd_get_filename (objfile->obfd);
+
+  return NULL;
+}
+
+/* See objfiles.h.  */
+
+const char *
+objfile_debug_name (const struct objfile *objfile)
+{
+  return lbasename (objfile->original_name);
+}
+
 /* Provide a prototype to silence -Wmissing-prototypes.  */
 extern initialize_file_ftype _initialize_objfiles;
 
This page took 0.024203 seconds and 4 git commands to generate.