mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-08 13:07:01 +00:00
gdbstub: Error locations for -gdb
Stash away the option argument with add_device_config(), so we still have its location when we get around to parsing it. This doesn't improve any messages I can see just yet, but that'll change shortly. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
d9a5954dbf
commit
ef0c4a0d89
10
vl.c
10
vl.c
@ -1857,6 +1857,7 @@ struct device_config {
|
|||||||
DEV_PARALLEL, /* -parallel */
|
DEV_PARALLEL, /* -parallel */
|
||||||
DEV_VIRTCON, /* -virtioconsole */
|
DEV_VIRTCON, /* -virtioconsole */
|
||||||
DEV_DEBUGCON, /* -debugcon */
|
DEV_DEBUGCON, /* -debugcon */
|
||||||
|
DEV_GDB, /* -gdb, -s */
|
||||||
} type;
|
} type;
|
||||||
const char *cmdline;
|
const char *cmdline;
|
||||||
Location loc;
|
Location loc;
|
||||||
@ -2182,7 +2183,6 @@ int qemu_init_main_loop(void)
|
|||||||
|
|
||||||
int main(int argc, char **argv, char **envp)
|
int main(int argc, char **argv, char **envp)
|
||||||
{
|
{
|
||||||
const char *gdbstub_dev = NULL;
|
|
||||||
int i;
|
int i;
|
||||||
int snapshot, linux_boot;
|
int snapshot, linux_boot;
|
||||||
const char *icount_option = NULL;
|
const char *icount_option = NULL;
|
||||||
@ -2607,10 +2607,10 @@ int main(int argc, char **argv, char **envp)
|
|||||||
log_file = optarg;
|
log_file = optarg;
|
||||||
break;
|
break;
|
||||||
case QEMU_OPTION_s:
|
case QEMU_OPTION_s:
|
||||||
gdbstub_dev = "tcp::" DEFAULT_GDBSTUB_PORT;
|
add_device_config(DEV_GDB, "tcp::" DEFAULT_GDBSTUB_PORT);
|
||||||
break;
|
break;
|
||||||
case QEMU_OPTION_gdb:
|
case QEMU_OPTION_gdb:
|
||||||
gdbstub_dev = optarg;
|
add_device_config(DEV_GDB, optarg);
|
||||||
break;
|
break;
|
||||||
case QEMU_OPTION_L:
|
case QEMU_OPTION_L:
|
||||||
data_dir = optarg;
|
data_dir = optarg;
|
||||||
@ -3500,9 +3500,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
}
|
}
|
||||||
text_consoles_set_display(ds);
|
text_consoles_set_display(ds);
|
||||||
|
|
||||||
if (gdbstub_dev && gdbserver_start(gdbstub_dev) < 0) {
|
if (foreach_device_config(DEV_GDB, gdbserver_start) < 0) {
|
||||||
fprintf(stderr, "qemu: could not open gdbserver on device '%s'\n",
|
|
||||||
gdbstub_dev);
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user