From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24510 invoked by alias); 1 Dec 2007 11:09:21 -0000 Received: (qmail 24502 invoked by uid 22791); 1 Dec 2007 11:09:20 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 01 Dec 2007 11:09:12 +0000 Received: (qmail 24608 invoked from network); 1 Dec 2007 11:09:10 -0000 Received: from unknown (HELO 172.16.unknown.plus.ru) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 1 Dec 2007 11:09:10 -0000 From: Vladimir Prus Date: Sat, 01 Dec 2007 11:09:00 -0000 Subject: [RFA] Report watchpoints hits for 'debug infrun'. To: gdb-patches@sources.redhat.com X-TUID: 900c77be4f03aae5 X-Length: 1754 X-UID: 83 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200712011409.02441.vladimir@codesourcery.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-12/txt/msg00007.txt.bz2 This patch make 'set debug infrun 1' produce more detailed information about watchpoint hits. OK? * gdb/infrun.c (handle_inferior_event): More detailed debugging about watchpoint hit. --- gdb/infrun.c | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index d79ed3f..6c62b60 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -1597,7 +1597,17 @@ handle_inferior_event (struct execution_control_state *ecs) stop_pc = read_pc_pid (ecs->ptid); if (debug_infrun) - fprintf_unfiltered (gdb_stdlog, "infrun: stop_pc = 0x%s\n", paddr_nz (stop_pc)); + { + CORE_ADDR addr; + fprintf_unfiltered (gdb_stdlog, "infrun: stop_pc = 0x%s\n", paddr_nz (stop_pc)); + if (STOPPED_BY_WATCHPOINT (*ws)) + { + fprintf_unfiltered (gdb_stdlog, "infrun: stopped by watchpoint\n"); + fprintf_unfiltered (gdb_stdlog, + "infrun: stopped data address = 0x%s\n", + paddr_nz (addr)); + } + } if (stepping_past_singlestep_breakpoint) { @@ -1823,9 +1833,6 @@ handle_inferior_event (struct execution_control_state *ecs) && (HAVE_STEPPABLE_WATCHPOINT || gdbarch_have_nonsteppable_watchpoint (current_gdbarch))) { - if (debug_infrun) - fprintf_unfiltered (gdb_stdlog, "infrun: STOPPED_BY_WATCHPOINT\n"); - /* At this point, we are stopped at an instruction which has attempted to write to a piece of memory under control of a watchpoint. The instruction hasn't actually executed -- 1.5.3.5