qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [gdbstub] redirecting qemu console output to a debugger
@ 2021-10-21 12:37 Sid Manning
  2021-10-21 13:11 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 4+ messages in thread
From: Sid Manning @ 2021-10-21 12:37 UTC (permalink / raw)
  To: qemu-devel@nongnu.org

Currently when I attach a debugger (lldb) to my qemu session all of the output goes to the shell running qemu not to the debugger.  Fixing this meant that I needed to point the semi-hosting output to the gdb chardev.  I started qemu like this:

-s -S -semihosting-config target=auto,chardev=ch0 -chardev gdb,id=ch0

But this failed with the error:
-chardev gdb,id=ch0: 'gdb' is not a valid char driver name

In order to fix this I needed to change the stub's chardev from internal to external:

@@ -3446,7 +3446,7 @@ static void char_gdb_class_init(ObjectClass *oc, void *data)
 {
     ChardevClass *cc = CHARDEV_CLASS(oc);
 
-    cc->internal = true;
+    cc->internal = false;
     cc->open = gdb_monitor_open;
     cc->chr_write = gdb_monitor_write;
 }

Afterward console output was routed to the debugger.  This is the only chardev device I found that is marked as internal so I suspect this is the wrong thing to do.  What is the proper way to redirect output from qemu to the debugger?

Thanks,


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-21 22:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-21 12:37 [gdbstub] redirecting qemu console output to a debugger Sid Manning
2021-10-21 13:11 ` Philippe Mathieu-Daudé
2021-10-21 14:51   ` Alex Bennée
2021-10-21 22:08     ` Sid Manning

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).