From: Jan Kiszka <jan.kiszka@siemens.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
Fabien Chouteau <chouteau@adacore.com>
Subject: [Qemu-devel] [PATCH v2 1/2] Add GDB qAttached support
Date: Fri, 26 Jul 2013 20:26:23 +0200 [thread overview]
Message-ID: <51F2BF4F.8030107@siemens.com> (raw)
In-Reply-To: <51E65168.5080907@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>
---
v2: Rebase over master
gdbstub.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/gdbstub.c b/gdbstub.c
index 35ca7c2..4a6cc51 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -42,6 +42,12 @@
#include "sysemu/kvm.h"
#include "qemu/bitops.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)
{
@@ -2489,6 +2495,10 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
break;
}
#endif
+ if (strncmp(p, "Attached", 8) == 0) {
+ put_packet(s, GDB_ATTACHED);
+ break;
+ }
/* Unrecognised 'q' command. */
goto unknown_command;
--
1.7.3.4
next prev parent reply other threads:[~2013-07-26 18:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-17 8:10 [Qemu-devel] [PATCH 1/2][RESENT] Add GDB qAttached support Jan Kiszka
2013-07-17 8:11 ` [Qemu-devel] [PATCH 2/2][RESENT] Revert "gdbstub: Do not kill target in system emulation mode" Jan Kiszka
2013-07-26 18:26 ` Jan Kiszka [this message]
2014-03-12 16:58 ` [Qemu-devel] [PATCH v2 1/2] Add GDB qAttached support Andreas Färber
2014-03-12 17:31 ` Jan Kiszka
2014-03-12 17:50 ` Peter Maydell
2014-03-12 7:37 ` [Qemu-devel] [PATCH 1/2][RESENT] " Jan Kiszka
2014-03-12 16:47 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51F2BF4F.8030107@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=aliguori@us.ibm.com \
--cc=chouteau@adacore.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.