diff options
author | Mihails Strasuns <mihails.strasuns@intel.com> | 2020-10-14 10:44:36 +0200 |
---|---|---|
committer | Mihails Strasuns <mihails.strasuns@intel.com> | 2020-10-19 16:52:34 +0200 |
commit | 61c26be85f0e09a208fa46ee839c74081c7d8124 (patch) | |
tree | 0c322cce6849ea19ed3ba531aa35debcec2995ed /gdb/frame.c | |
parent | 0f03783c8e9f14d02749081815949493bb28d4e3 (diff) | |
download | gdb-61c26be85f0e09a208fa46ee839c74081c7d8124.zip gdb-61c26be85f0e09a208fa46ee839c74081c7d8124.tar.gz gdb-61c26be85f0e09a208fa46ee839c74081c7d8124.tar.bz2 |
gdb: get jiter objfile from a bound minsym
This fixes a regression introduced by the following commit:
fe053b9e853 gdb/jit: pass the jiter objfile as an argument to jit_event_handler
In the refactoring `handle_jit_event` function was changed to pass a matching
objfile pointer to the `jit_event_handler` explicitly, rather using internal
storage:
```
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -5448,8 +5448,9 @@ handle_jit_event (void)
frame = get_current_frame ();
gdbarch = get_frame_arch (frame);
+ objfile *jiter = symbol_objfile (get_frame_function (frame));
- jit_event_handler (gdbarch);
+ jit_event_handler (gdbarch, jiter);
```
This was needed to add support for multiple jiters. However it has also
introduced a regression, because `get_frame_function (frame)` here may
return `nullptr`, resulting in a crash.
A more resilient way would be to use an approach mirroring
`jit_breakpoint_re_set` - to find a minimal symbol matching the
breakpoint location and use its object file. We know that this
breakpoint event comes from a breakpoint set by `jit_breakpoint_re_set`,
thus using the reverse approach should be reliable enough.
gdb/Changelog:
2020-10-14 Mihails Strasuns <mihails.strasuns@intel.com>
* breakpoint.c (handle_jit_event): Add an argument, change how
`jit_event_handler` is called.
Diffstat (limited to 'gdb/frame.c')
0 files changed, 0 insertions, 0 deletions