diff options
author | Tom Tromey <tom@tromey.com> | 2023-08-01 15:09:49 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-08-26 10:10:59 -0600 |
commit | 9030a82d6f700e03ab143f0d002e9f21ae2fd52f (patch) | |
tree | 6c8cb41f79076800fa6473f430d719d38192c386 /gdb/stack.c | |
parent | d2ac569f7b443aef7b2be2f0c80d8ab0d67b4292 (diff) | |
download | gdb-9030a82d6f700e03ab143f0d002e9f21ae2fd52f.zip gdb-9030a82d6f700e03ab143f0d002e9f21ae2fd52f.tar.gz gdb-9030a82d6f700e03ab143f0d002e9f21ae2fd52f.tar.bz2 |
Use get_frame_address_in_block in print_frame
The author of 'mold' pointed out that with a certain shared library,
gdb would fail to find the shared library's name in 'bt'.
The function in question appeared at the end of the .so's .text
segment and ended with a call to 'abort'.
This turned out to be a classic case of calling get_frame_pc when
get_frame_address_in_block is needed -- the former will be off-by-one
for purposes of finding the enclosing function or shared library.
The included test fails without the patch on my system. However, I
imagine it can't be assumed to reliably fail. Nevertheless it seemed
worth doing.
Regression tested on x86-64 Fedora 38.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29074
Reviewed-by: Kevin Buettner <kevinb@redhat.com>
Diffstat (limited to 'gdb/stack.c')
-rw-r--r-- | gdb/stack.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/stack.c b/gdb/stack.c index 002bf58..0b35d62 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -1420,7 +1420,7 @@ print_frame (const frame_print_options &fp_opts, { const char *lib = solib_name_from_address (get_frame_program_space (frame), - get_frame_pc (frame)); + get_frame_address_in_block (frame)); if (lib) { |