All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH 1/2] Add GDB qAttached support
@ 2015-01-31  9:28 ` Jan Kiszka
  0 siblings, 0 replies; 10+ messages in thread
From: Jan Kiszka @ 2015-01-31  9:28 UTC (permalink / raw)
  To: qemu-trivial; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1408 bytes --]

From: Jan Kiszka <jan.kiszka@siemens.com>

With this patch QEMU handles qAttached request from gdb. When QEMU
replies 1, GDB sends a "detach" command at the end of a debugging
session otherwise GDB sends "kill".

The default value for qAttached is 1 on system emulation and 0 on user
emulation.

Based on original version by Fabien Chouteau.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Long pending in my queue. Hope we can finally get these two in via
trivial (that's what they are).

 gdbstub.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gdbstub.c b/gdbstub.c
index e4a1a79..da3e7cb 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -41,6 +41,12 @@
 #include "qemu/sockets.h"
 #include "sysemu/kvm.h"
 
+#ifdef CONFIG_USER_ONLY
+#define GDB_ATTACHED "0"
+#else
+#define GDB_ATTACHED "1"
+#endif
+
 static inline int target_memory_rw_debug(CPUState *cpu, target_ulong addr,
                                          uint8_t *buf, int len, bool is_write)
 {
@@ -1187,6 +1193,10 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
             put_packet_binary(s, buf, len + 1);
             break;
         }
+        if (strncmp(p, "Attached", 8) == 0) {
+            put_packet(s, GDB_ATTACHED);
+            break;
+        }
         /* Unrecognised 'q' command.  */
         goto unknown_command;
 
-- 
2.1.4


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-02-04 14:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-31  9:28 [Qemu-trivial] [PATCH 1/2] Add GDB qAttached support Jan Kiszka
2015-01-31  9:28 ` [Qemu-devel] " Jan Kiszka
2015-01-31  9:29 ` [Qemu-trivial] [PATCH 2/2] Revert "gdbstub: Do not kill target in system emulation mode" Jan Kiszka
2015-01-31  9:29   ` [Qemu-devel] " Jan Kiszka
2015-02-04 13:36 ` [Qemu-trivial] [Qemu-devel] [PATCH 1/2] Add GDB qAttached support Pedro Alves
2015-02-04 13:36   ` Pedro Alves
2015-02-04 14:06   ` [Qemu-trivial] " Jan Kiszka
2015-02-04 14:06     ` Jan Kiszka
2015-02-04 14:30   ` [Qemu-trivial] " Peter Maydell
2015-02-04 14:30     ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.