From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KAn9C-00057b-17 for qemu-devel@nongnu.org; Mon, 23 Jun 2008 10:35:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KAn9A-00056M-NF for qemu-devel@nongnu.org; Mon, 23 Jun 2008 10:35:57 -0400 Received: from [199.232.76.173] (port=57331 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KAn9A-000560-AW for qemu-devel@nongnu.org; Mon, 23 Jun 2008 10:35:56 -0400 Received: from gecko.sbs.de ([194.138.37.40]:19933) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KAn97-0004tD-RX for qemu-devel@nongnu.org; Mon, 23 Jun 2008 10:35:54 -0400 Received: from mail1.sbs.de (localhost [127.0.0.1]) by gecko.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id m5NEZnb0002131 for ; Mon, 23 Jun 2008 16:35:49 +0200 Received: from [139.25.109.167] (mchn012c.mchp.siemens.de [139.25.109.167] (may be forged)) by mail1.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id m5NEZnYK017943 for ; Mon, 23 Jun 2008 16:35:49 +0200 Resent-To: qemu-devel@nongnu.org Resent-Message-Id: <485FB4C5.80706@siemens.com> Message-ID: <485FB28C.2010008@siemens.com> Date: Mon, 23 Jun 2008 16:26:20 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <485FB18E.1090801@siemens.com> In-Reply-To: <485FB18E.1090801@siemens.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 5/15] Return appropriate watch message to gdb Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Return the appropriate type prefix (r, a, none) when reporting watchpoint hits to the gdb front-end. Signed-off-by: Jan Kiszka --- gdbstub.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) Index: b/gdbstub.c =================================================================== --- a/gdbstub.c +++ b/gdbstub.c @@ -1225,6 +1225,7 @@ static void gdb_vm_stopped(void *opaque, { GDBState *s = opaque; char buf[256]; + const char *type; int ret; if (s->state == RS_SYSCALL) @@ -1235,8 +1236,20 @@ static void gdb_vm_stopped(void *opaque, if (reason == EXCP_DEBUG) { if (s->env->watchpoint_hit) { - snprintf(buf, sizeof(buf), "T%02xwatch:" TARGET_FMT_lx ";", - SIGTRAP, + switch (s->env->watchpoint[s->env->watchpoint_hit - 1].flags & + (PAGE_READ | PAGE_WRITE)) { + case PAGE_READ: + type = "r"; + break; + case PAGE_READ | PAGE_WRITE: + type = "a"; + break; + default: + type = ""; + break; + } + snprintf(buf, sizeof(buf), "T%02x%swatch:" TARGET_FMT_lx ";", + SIGTRAP, type, s->env->watchpoint[s->env->watchpoint_hit - 1].vaddr); put_packet(s, buf); s->env->watchpoint_hit = 0;