diff options
author | Felix Willgerodt <felix.willgerodt@intel.com> | 2021-11-04 15:46:45 +0100 |
---|---|---|
committer | Felix Willgerodt <felix.willgerodt@intel.com> | 2023-05-08 09:19:29 +0200 |
commit | c239019c9f649867c686204d1ac8947a963784d8 (patch) | |
tree | 9b765b5804823303d0f945b73bca16748da9c88b /gdb/infcmd.c | |
parent | f35cc0decdd7595b34daa30803038342864b7888 (diff) | |
download | gdb-c239019c9f649867c686204d1ac8947a963784d8.zip gdb-c239019c9f649867c686204d1ac8947a963784d8.tar.gz gdb-c239019c9f649867c686204d1ac8947a963784d8.tar.bz2 |
gdb: Avoid warning for the jump command inside an inline function.
When stopped inside an inline function, trying to jump to a different line
of the same function currently results in a warning about jumping to another
function. Fix this by taking inline functions into account.
Before:
Breakpoint 1, function_inline (x=510) at jump-inline.cpp:22
22 a = a + x; /* inline-funct */
(gdb) j 21
Line 21 is not in `function_inline(int)'. Jump anyway? (y or n)
After:
Breakpoint 2, function_inline (x=510) at jump-inline.cpp:22
22 a = a + x; /* inline-funct */
(gdb) j 21
Continuing at 0x400679.
Breakpoint 1, function_inline (x=510) at jump-inline.cpp:21
21 a += 1020 + a; /* increment-funct */
This was regression-tested on X86-64 Linux.
Co-Authored-by: Cristian Sandu <cristian.sandu@intel.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r-- | gdb/infcmd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c index e429278..b12b58d 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -1081,7 +1081,8 @@ jump_command (const char *arg, int from_tty) /* See if we are trying to jump to another function. */ fn = get_frame_function (get_current_frame ()); - sfn = find_pc_function (sal.pc); + sfn = find_pc_sect_containing_function (sal.pc, + find_pc_mapped_section (sal.pc)); if (fn != nullptr && sfn != fn) { if (!query (_("Line %d is not in `%s'. Jump anyway? "), sal.line, |