From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L0jE6-0001Si-Fc for qemu-devel@nongnu.org; Thu, 13 Nov 2008 15:55:42 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L0jE4-0001SM-VS for qemu-devel@nongnu.org; Thu, 13 Nov 2008 15:55:42 -0500 Received: from [199.232.76.173] (port=51025 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0jE4-0001SJ-Q2 for qemu-devel@nongnu.org; Thu, 13 Nov 2008 15:55:40 -0500 Received: from ug-out-1314.google.com ([66.249.92.168]:51732) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L0jE4-0005xv-Ar for qemu-devel@nongnu.org; Thu, 13 Nov 2008 15:55:40 -0500 Received: by ug-out-1314.google.com with SMTP id 29so1737323ugc.36 for ; Thu, 13 Nov 2008 12:55:38 -0800 (PST) Message-ID: <491C91EA.4000102@codemonkey.ws> Date: Thu, 13 Nov 2008 14:45:30 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 02/12] Return appropriate watch message to gdb References: <20081103103558.213902776@mchn012c.ww002.siemens.net> <20081103103558.776161757@mchn012c.ww002.siemens.net> In-Reply-To: <20081103103558.776161757@mchn012c.ww002.siemens.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 Cc: Jan Kiszka Jan Kiszka wrote: > Return the appropriate type prefix (r, a, none) when reporting > watchpoint hits to the gdb front-end. > This doesn't build on it's own (there is no flags field in watchpoint). Regards, Anthony Liguori > 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 > @@ -1493,6 +1493,7 @@ static void gdb_vm_stopped(void *opaque, > { > GDBState *s = opaque; > char buf[256]; > + const char *type; > int ret; > > if (s->state == RS_SYSCALL) > @@ -1503,8 +1504,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; > > > >