From: Doug Goldstein Date: Sun, 16 Mar 2014 15:47:39 +0000 (-0500) Subject: gdb: support qAttached command from debugger X-Git-Tag: v1.2~8^2~2 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=6981970786d7de8e9507f0c02def6473efd76f56;p=sx%2Fsimavr.git gdb: support qAttached command from debugger When using avr-gdb on Ubuntu 12.04, this command is always sent and we responded as if it was unsupported. Unfortunately avr-gdb on Ubuntu 12.04 crashes when detaching from the process because it makes a bad assumption somewhere, this will prevent the crash. --- diff --git a/simavr/sim/sim_gdb.c b/simavr/sim/sim_gdb.c index 80be31a..263b245 100644 --- a/simavr/sim/sim_gdb.c +++ b/simavr/sim/sim_gdb.c @@ -287,6 +287,16 @@ gdb_handle_command( char rep[1024]; uint8_t command = *cmd++; switch (command) { + case 'q': + if (strncmp(cmd, "Attached", 8) == 0) { + /* Respond that we are attached to an existing process.. + * ourselves! + */ + gdb_send_reply(g, "1"); + break; + } + gdb_send_reply(g, ""); + break; case '?': gdb_send_quick_status(g, 0); break;