aboutsummaryrefslogtreecommitdiff
path: root/gdb/objfiles.h
diff options
context:
space:
mode:
authorJan Vrany <jan.vrany@labware.com>2022-12-08 11:30:25 +0000
committerJan Vrany <jan.vrany@labware.com>2022-12-08 11:30:25 +0000
commit05a1f6468ea806239f0cd5605732a09023a90e0a (patch)
tree4b4e58b5493b370789a7636a0f4db009fe7e11df /gdb/objfiles.h
parent57336e2e4d05eaac6367400e6ce3aed24f838f2c (diff)
downloadgdb-05a1f6468ea806239f0cd5605732a09023a90e0a.zip
gdb-05a1f6468ea806239f0cd5605732a09023a90e0a.tar.gz
gdb-05a1f6468ea806239f0cd5605732a09023a90e0a.tar.bz2
gdb: skip objfiles with no BFD in DWARF unwinder
While playing with JIT reader I experienced GDB to crash on null-pointer dereference when stepping through non-jitted code. The problem was that dwarf2_frame_find_fde () assumed that all objfiles have BFD but that's not always true. To address this problem, this commit skips such objfiles. To test the fix we put breakpoint in jit_function_add (). The JIT reader does not know how unwind this function so unwinding eventually falls back to DWARF unwinder which in turn iterates over objfiles. Since the the code is jitted, it is guaranteed it would eventually process JIT objfile. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/objfiles.h')
-rw-r--r--gdb/objfiles.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index 9a152cb..0d887ce 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -646,7 +646,9 @@ public:
struct compunit_symtab *compunit_symtabs = nullptr;
/* The object file's BFD. Can be null if the objfile contains only
- minimal symbols, e.g. the run time common symbols for SunOS4. */
+ minimal symbols (e.g. the run time common symbols for SunOS4) or
+ if the objfile is a dynamic objfile (e.g. created by JIT reader
+ API). */
gdb_bfd_ref_ptr obfd;