aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorPuputti, Matti <matti.puputti@intel.com>2023-07-26 12:29:15 +0000
committerAndrew Burgess <aburgess@redhat.com>2023-08-16 09:55:52 +0100
commitda1f552dc79476275af282b65c5317ab3b4dbd9a (patch)
treeae9eb538fb263b9ce15654b44cf868e47923d6a7 /gas
parentba22cd5e8852a3ad0a94fc268dbd244eb0aae4e7 (diff)
downloadgdb-da1f552dc79476275af282b65c5317ab3b4dbd9a.zip
gdb-da1f552dc79476275af282b65c5317ab3b4dbd9a.tar.gz
gdb-da1f552dc79476275af282b65c5317ab3b4dbd9a.tar.bz2
gdb, infcmd: support jump command in multi-inferior case
Fixes the issue where jump failed if multiple inferiors run the same source. See the below example $ gdb -q ./simple Reading symbols from ./simple... (gdb) break 2 Breakpoint 1 at 0x114e: file simple.c, line 2. (gdb) run Starting program: /temp/simple Breakpoint 1, main () at simple.c:2 2 int a = 42; (gdb) add-inferior [New inferior 2] Added inferior 2 on connection 1 (native) (gdb) inferior 2 [Switching to inferior 2 [<null>] (<noexec>)] (gdb) info inferiors Num Description Connection Executable 1 process 6250 1 (native) /temp/simple * 2 <null> 1 (native) (gdb) file ./simple Reading symbols from ./simple... (gdb) run Starting program: /temp/simple Thread 2.1 "simple" hit Breakpoint 1, main () at simple.c:2 2 int a = 42; (gdb) info inferiors Num Description Connection Executable 1 process 6250 1 (native) /temp/simple * 2 process 6705 1 (native) /temp/simple (gdb) jump 3 Unreasonable jump request (gdb) In this example, jump fails because the debugger finds two different locations, one for each inferior. Solution is to limit the search to the current program space. This is done by having the jump_command function use decode_line_with_current_source rather than decode_line_with_last_displayed, which makes sense, the *_current_source function always looks up a location based on the current thread's location -- if a user is asking the current thread to jump, then surely their destination should be relative to where the current thread is located. Then, inside decode_line_with_current_source, the call to decode_line_1 is updated to pass through the current program_space, which will limit the returned locations to those in the current program space. Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gas')
0 files changed, 0 insertions, 0 deletions