Commit 6981970786d7de8e9507f0c02def6473efd76f56
authorDoug Goldstein <cardoe@cardoe.com>
Sun, 16 Mar 2014 15:47:39 +0000 (10:47 -0500)
committerDoug Goldstein <cardoe@cardoe.com>
Mon, 17 Mar 2014 02:00:04 +0000 (21:00 -0500)
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

index 80be31af02ec1afa13fee844c78af279bdcf1aa0..263b245116e53d8be5b63b1e27aa8fafa47a8d7d 100644 (file)
@@ -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;