From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ruljm-0001Up-Ls for qemu-devel@nongnu.org; Tue, 07 Feb 2012 09:09:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ruljf-0005f9-FG for qemu-devel@nongnu.org; Tue, 07 Feb 2012 09:09:38 -0500 Received: from oxygen.pond.sub.org ([78.46.104.156]:39186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ruljf-0005eS-Aa for qemu-devel@nongnu.org; Tue, 07 Feb 2012 09:09:31 -0500 From: Markus Armbruster Date: Tue, 7 Feb 2012 15:09:13 +0100 Message-Id: <1328623766-12287-7-git-send-email-armbru@redhat.com> In-Reply-To: <1328623766-12287-1-git-send-email-armbru@redhat.com> References: <1328623766-12287-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 06/19] gdbstub: Error locations for -gdb List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, aliguori@us.ibm.com 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 --- vl.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/vl.c b/vl.c index e252a9d..1394a08 100644 --- a/vl.c +++ b/vl.c @@ -1857,6 +1857,7 @@ struct device_config { DEV_PARALLEL, /* -parallel */ DEV_VIRTCON, /* -virtioconsole */ DEV_DEBUGCON, /* -debugcon */ + DEV_GDB, /* -gdb, -s */ } type; const char *cmdline; Location loc; @@ -2178,7 +2179,6 @@ int qemu_init_main_loop(void) int main(int argc, char **argv, char **envp) { - const char *gdbstub_dev = NULL; int i; int snapshot, linux_boot; const char *icount_option = NULL; @@ -2598,10 +2598,10 @@ int main(int argc, char **argv, char **envp) log_file = optarg; break; case QEMU_OPTION_s: - gdbstub_dev = "tcp::" DEFAULT_GDBSTUB_PORT; + add_device_config(DEV_GDB, "tcp::" DEFAULT_GDBSTUB_PORT); break; case QEMU_OPTION_gdb: - gdbstub_dev = optarg; + add_device_config(DEV_GDB, optarg); break; case QEMU_OPTION_L: data_dir = optarg; @@ -3482,9 +3482,7 @@ int main(int argc, char **argv, char **envp) } text_consoles_set_display(ds); - if (gdbstub_dev && gdbserver_start(gdbstub_dev) < 0) { - fprintf(stderr, "qemu: could not open gdbserver on device '%s'\n", - gdbstub_dev); + if (foreach_device_config(DEV_GDB, gdbserver_start) < 0) { exit(1); } -- 1.7.6.5