This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
GDB extended-remote run problem
- From: "Jon Beniston" <jon at beniston dot com>
- To: <gdb at sourceware dot org>
- Date: Sat, 24 Sep 2016 10:51:54 +0100
- Subject: GDB extended-remote run problem
- Authentication-results: sourceware.org; auth=none
Hi,
I'm trying to use gdb 7.11 with an extended-remote target to gdbserver. It
seems that the 'run' command can get confused thinking the target is
running, even though it has stopped, if the 'run' command is executed before
a 'continue' command.
Here's an example session, that shows the problem:
>gdbserver --once --remote-debug :1025 test
> gdb test
(gdb) tar ext:1025
(gdb) b main
(gdb) set debug remote 1
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/jon/workspace/test/Debug/test
* snip*
ending packet: $vCont?#49...Packet received: vCont;c;C;t;s;S;r
Packet vCont (verbose-resume) is supported
Sending packet: $vCont;c:p9991.-1#ba...Packet received:
T05swbreak:;06:0000000000000000;07:90e0ffffff7f0000;10:3004400000000000;thre
ad:p9991.9991;core:2;
Sending packet: $m400430,1#f5...Packet received: 31
Sending packet: $m400430,1#f5...Packet received: 31
* hangs *
^C^CInterrupted while waiting for the program.
Give up waiting? (y or n)
(gdb) info threads
* 1 Thread 39202.39202 "test" (running)
So even though the T05swbreak packet was sent, GDB doesn't seem to think the
target has stopped.
In order to get run to work, it seems after the target command, a continue
is needed, then can run can be used at will. E.g:
> gdb test
(gdb) tar ext:1025
(gdb) b main
(gdb) c
Continuing.
Breakpoint 1, main () at ../src/test.c:17
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/jon/workspace/test/Debug/test
Breakpoint 1, main () at ../src/test.c:17
17 x = 5;
Cheers,
Jon