From 6981970786d7de8e9507f0c02def6473efd76f56 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Sun, 16 Mar 2014 10:47:39 -0500 Subject: [PATCH] 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. --- simavr/sim/sim_gdb.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; -- 2.39.5