Skip to contentSkip to conversation

gdbstub: print message on startup as gdbserver

PATCH In review [email protected] 2 participants 2 messages Jun 19, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gdbstub: print message on startup as gdbserver

From: Lukas Durfina <[email protected]>

It helps to test gdb running qemu instead of a gdbserver. It prints the same message as the gdbserver on startup.

---
 gdbstub.c | 1 +
 1 file changed, 1 insertion(+)
gdbstub.c +1 -0
index 8618e34311..9ad9929968 100644
@@ -3109,6 +3109,7 @@ int gdbserver_start(int port)
     gdbserver_fd = gdbserver_open(port);
     if (gdbserver_fd < 0)
         return -1;
+    printf("Listening on port %d\n", port);
     /* accept connections */
     if (!gdb_accept()) {
         close(gdbserver_fd);
Signature · 1 line
2.17.1
#1 lore raw
Quoted 15 lines · [email protected] writes:

From: Lukas Durfina <[email protected]>

It helps to test gdb running qemu instead of a gdbserver. It prints the same message as the gdbserver on startup.

---
 gdbstub.c | 1 +
 1 file changed, 1 insertion(+)
gdbstub.c +0 -0
index 8618e34311..9ad9929968 100644

gdbstub.c int gdbserver_start(int port) · line 3112

Quoted 4 lines
gdbstub.c +1 -0
@@ -3109,6 +3109,7 @@ int gdbserver_start(int port)
     gdbserver_fd = gdbserver_open(port);
     if (gdbserver_fd < 0)
         return -1;
+    printf("Listening on port %d\n", port);

Not really - we don't arbitrarily output stuff on stdout. In fact the best way to track what gdbserver is doing is to use the built-in trace points:

$QEMU -d trace:gdb\* $QEMU_ARGS

For system emulation from the console you can run:

(qemu) info chardev

which will report the state of the gdb connection:

gdb: filename=disconnected:tcp:0.0.0.0:1234,server

gdbstub.c int gdbserver_start(int port) · line 3115

Quoted 3 lines
gdbstub.c +0 -0
     /* accept connections */
     if (!gdb_accept()) {
         close(gdbserver_fd);

--
Alex Bennée