Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L2Wfq-0002Fl-OY for qemu-devel@nongnu.org; Tue, 18 Nov 2008 14:55:46 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L2Wfp-0002Ej-WD for qemu-devel@nongnu.org; Tue, 18 Nov 2008 14:55:46 -0500 Received: from [199.232.76.173] (port=35542 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L2Wfp-0002EV-RC for qemu-devel@nongnu.org; Tue, 18 Nov 2008 14:55:45 -0500 Received: from savannah.gnu.org ([199.232.41.3]:50753 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L2Wfp-0005NB-Lq for qemu-devel@nongnu.org; Tue, 18 Nov 2008 14:55:45 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1L2Wfo-0007dR-SB for qemu-devel@nongnu.org; Tue, 18 Nov 2008 19:55:44 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1L2Wfo-0007dF-J0 for qemu-devel@nongnu.org; Tue, 18 Nov 2008 19:55:44 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Tue, 18 Nov 2008 19:55:44 +0000 Subject: [Qemu-devel] [5737] gdbstub: Return appropriate watch message to gdb (Jan Kiszka) 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 Revision: 5737 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5737 Author: aliguori Date: 2008-11-18 19:55:44 +0000 (Tue, 18 Nov 2008) Log Message: ----------- gdbstub: Return appropriate watch message to gdb (Jan Kiszka) Return the appropriate type prefix (r, a, none) when reporting watchpoint hits to the gdb front-end. Signed-off-by: Jan Kiszka Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/gdbstub.c Modified: trunk/gdbstub.c =================================================================== --- trunk/gdbstub.c 2008-11-18 19:46:41 UTC (rev 5736) +++ trunk/gdbstub.c 2008-11-18 19:55:44 UTC (rev 5737) @@ -1493,6 +1493,7 @@ { GDBState *s = opaque; char buf[256]; + const char *type; int ret; if (s->state == RS_SYSCALL) @@ -1503,8 +1504,20 @@ 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].type & + (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;