[v12,24/32] solib_find: Search also by build-id
Commit Message
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
@@ -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.)