[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gdbstub] redirecting qemu console output to a debugger
From: |
Sid Manning |
Subject: |
[gdbstub] redirecting qemu console output to a debugger |
Date: |
Thu, 21 Oct 2021 12:37:42 +0000 |
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,
- [gdbstub] redirecting qemu console output to a debugger,
Sid Manning <=