This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v12 24/32] solib_find: Search also by build-id
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 21 Aug 2015 23:23:21 +0200
- Subject: [PATCH v12 24/32] solib_find: Search also by build-id
- Authentication-results: sourceware.org; auth=none
- References: <20150821212006 dot 6673 dot 35100 dot stgit at host1 dot jankratochvil dot net>
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.)