Philippe Waille wrote: > Hi > > Qemu gdbstub only allows GDB remote target connexion through IP socket. > > Would the GDB remote pipe connexion method be also supported in future versions > (as does openocd for remote access to jtag interfaces), like this : > > (gdb) target remote | exec openocd --pipe > (gdb) target remote | exec qemu-arm --pipe a.out > > Simultaneous execution of several (user-mode arm simulators) qemu-arm by a > set of users sharing a single server would be easier to manage with > gdb connexion through pipes instead of IP port/socket. Check out [1]. It basically enhances qemu like that (the corresponding switch would be '-gdb stdio'), but only for system emulation. An add-on patch to extend user mode emulator in a similar way would be welcome! There is one more thing to solve for both emulator modes: SIGINT has to be trapped and handled by the gdbstub (currently, breaking into the target terminates qemu). These hunks do the trick for system emulation: diff --git a/gdbstub.c b/gdbstub.c index a087553..1f43264 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -2446,6 +2446,14 @@ static int gdb_monitor_write(CharDriverState *chr, const uint8_t *buf, int len) return len; } +#ifndef _WIN32 +static void gdb_sigterm_handler(int signal) +{ + if (vm_running) + vm_stop(EXCP_INTERRUPT); +} +#endif + int gdbserver_start(const char *device) { GDBState *s; @@ -2462,7 +2470,15 @@ int gdbserver_start(const char *device) "%s,nowait,nodelay,server", device); device = gdbstub_device_name; } +#ifndef _WIN32 + else if (strcmp(device, "stdio") == 0) { + struct sigaction act; + memset(&act, 0, sizeof(act)); + act.sa_handler = gdb_sigterm_handler; + sigaction(SIGINT, &act, NULL); + } +#endif chr = qemu_chr_open("gdb", device, NULL); if (!chr) return -1; Will merge this into some -v2 of my patch. Jan [1] http://permalink.gmane.org/gmane.comp.emulators.qemu/39836