Enhance gdb.lookup_objfile so that it works with a symlinked binary.
[deliverable/binutils-gdb.git] / gdb / objfiles.c
index c397f6872c1a85fa962b682f8a633d1182f75f10..ff20bc8fcffdef56c36451c77f6cfe3727e2e395 100644 (file)
@@ -1492,7 +1492,7 @@ default_iterate_over_objfiles_in_search_order
     }
 }
 
-/* Return canonical name for OBJFILE.  */
+/* See objfiles.h.  */
 
 const char *
 objfile_name (const struct objfile *objfile)
@@ -1505,6 +1505,17 @@ objfile_name (const struct objfile *objfile)
 
 /* 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)
 {
This page took 0.027691 seconds and 4 git commands to generate.