diff options
Diffstat (limited to 'gdbstub.c')
-rw-r--r-- | gdbstub.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1732,6 +1732,10 @@ int gdbserver_start(const char *device) CharDriverState *chr = NULL; CharDriverState *mon_chr; ChardevCommon common = { 0 }; + static const CharDriver driver = { + .kind = -1, + .chr_write = gdb_monitor_write, + }; if (!first_cpu) { error_report("gdbstub: meaningless to attach gdb to a " @@ -1770,8 +1774,7 @@ int gdbserver_start(const char *device) qemu_add_vm_change_state_handler(gdb_vm_state_change, NULL); /* Initialize a monitor terminal for gdb */ - mon_chr = qemu_chr_alloc(&common, &error_abort); - mon_chr->chr_write = gdb_monitor_write; + mon_chr = qemu_chr_alloc(&driver, &common, &error_abort); monitor_init(mon_chr, 0); } else { if (qemu_chr_fe_get_driver(&s->chr)) { |