This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH v12 24/32] solib_find: Search also by build-id


Hi,

solib_find() can now try to search also by build-id.


Jan


gdb/ChangeLog
2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* solib.c: Include build-id.h.
	(solib_find_3): Call build_id_to_file.
---
 0 files changed

diff --git a/gdb/solib.c b/gdb/solib.c
index b044e72..a425e4d 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -47,6 +47,7 @@
 #include "gdb_bfd.h"
 #include "filestuff.h"
 #include "source.h"
+#include "build-id.h"
 
 /* Architecture-specific operations.  */
 
@@ -313,6 +314,17 @@ solib_find_3 (char *in_pathname, enum openp_flags opts, int is_solib,
 
   /* We try to find the library in various ways.  */
 
+  if (build_idsz != 0)
+    {
+      file = build_id_to_file (build_idsz, build_id, "", opts);
+      if (file_location_is_valid (&file))
+	{
+	  do_cleanups (old_chain);
+	  return file;
+	}
+      file_location_free (&file);
+    }
+
   /* If the search in gdb_sysroot failed, and the path name is
      absolute at this point, make it relative.  (openp will try and open the
      file according to its absolute path otherwise, which is not what we want.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]