aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib.c
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2024-07-31 15:54:52 +0100
committerAndrew Burgess <aburgess@redhat.com>2024-11-10 10:18:22 +0000
commitef1a41f20b7ea4799e09b37312dc051245435fd1 (patch)
tree22c04a38ed29a6dbc56bd67e0e3d51ddbe682cfd /gdb/solib.c
parent629bcc68d799ff77a5f174e2f5300f9a26a83521 (diff)
downloadgdb-ef1a41f20b7ea4799e09b37312dc051245435fd1.zip
gdb-ef1a41f20b7ea4799e09b37312dc051245435fd1.tar.gz
gdb-ef1a41f20b7ea4799e09b37312dc051245435fd1.tar.bz2
gdb: add extension hook ext_lang_find_objfile_from_buildid
Add a new ext_lang_find_objfile_from_buildid function which is called from find_objfile_by_build_id and gives extension languages a chance to find missing objfiles. This commit adds the ext_lang_find_objfile_from_buildid function and the extension_language_ops::find_objfile_from_buildid() hook, but does not implement the hook for any extension languages, that will come in the next commit. This commit does rewrite find_objfile_by_build_id (build-id.c) to call the new hook though. The basic steps of find_objfile_by_build_id are now this: 1. Try to find the missing objfile using the build-id by looking in the debug-file-directory's .build-id/ sub-directory. If we find the file then we're done. 2. Ask debuginfod to download the missing file for us. If we download the file successfully then we're done. 3. Ask the extension language hook to find the file for us. If the extension language asks us to try again then we repeat step (1) only and if we still don't have the file, we move to step (4). If the extension language told us where the file is then we use that file and we're done. 4. We didn't find the file. Carry on without it. Only step (3) is new in this logic, everything else was already done. There are no tests added here as we can't currently write an extension language callback. The next commit will add the tests. Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/solib.c')
-rw-r--r--gdb/solib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/solib.c b/gdb/solib.c
index 5c926de..dfcee43 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -525,7 +525,8 @@ solib_map_sections (solib &so)
abfd = nullptr;
if (abfd == nullptr)
- abfd = find_objfile_by_build_id (mapped_file_info->build_id (),
+ abfd = find_objfile_by_build_id (current_program_space,
+ mapped_file_info->build_id (),
so.so_name.c_str ());
if (abfd == nullptr && mismatch)