]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: update is_addr_in_objfile to support "dynamic" objfiles
authorJan Vrany <jan.vrany@labware.com>
Thu, 21 Nov 2024 12:31:20 +0000 (12:31 +0000)
committerJan Vrany <jan.vrany@labware.com>
Thu, 21 Nov 2024 12:31:20 +0000 (12:31 +0000)
commit0d2f828428cb71f397c5759232988081ac202477
tree2da180b88dac685e1ca58a986f90aa38ccde060b
parentbe740e7cc62fed098ad62cef3b2e2b25b44d8748
gdb: update is_addr_in_objfile to support "dynamic" objfiles

While working with objfiles in Python I noticed that
gdb.Progspace.objfile_for_address () does not return "dynamic" objfile
create by (for example) GDB's JIT reader API.

This is because is_addr_in_objfile() checks if given address falls into
any (mappped) section of that objfile. However objfiles created by JIT
reader API do not have sections.

To solve this issue, this commit updates is_addr_in_objfile() to also
check if address fall into any compunit if that objfile. It does so only
if objfile has no sections.
gdb/objfiles.c
gdb/testsuite/gdb.base/jit-reader.exp