From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17844 invoked by alias); 3 Oct 2009 17:11:12 -0000 Received: (qmail 17834 invoked by uid 22791); 3 Oct 2009 17:11:11 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 03 Oct 2009 17:11:04 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n93HB2bO000816 for ; Sat, 3 Oct 2009 13:11:03 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n93HB038023235 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 3 Oct 2009 13:11:02 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id n93HB05L017298 for ; Sat, 3 Oct 2009 19:11:00 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id n93HB0YX017297 for gdb-patches@sourceware.org; Sat, 3 Oct 2009 19:11:00 +0200 Date: Sat, 03 Oct 2009 17:11:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch 3/4] Fix hw watchpoints: remove dead code [update] Message-ID: <20091003171059.GC26203@host0.dyn.jankratochvil.net> References: <20090817194624.GD10694@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090817194624.GD10694@host0.dyn.jankratochvil.net> User-Agent: Mutt/1.5.20 (2009-08-17) X-IsSubscribed: yes 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: 2009-10/txt/msg00087.txt.bz2 Hi, just a rediff on top of the patch 1/4. Thanks, Jan ------------------------------------------------------------------------------ simple dead code removal. Code would become invalid with the changes anyway. The testcase is in fact unrelated, just I was surprised "hbreak" functionality is currently not regression tested anywhere. gdb/ 2009-08-17 Jan Kratochvil * i386-nat.c (i386_stopped_by_hwbp): Remove. gdb/testsuite/ 2009-10-03 Jan Kratochvil * gdb.base/watchpoint-hw.exp: New variable breakline. (hbreak, continue to break-at-exit after hbreak): New tests. --- a/gdb/i386-nat.c +++ b/gdb/i386-nat.c @@ -593,27 +593,6 @@ i386_stopped_by_watchpoint (void) return target_stopped_data_address (¤t_target, &addr); } -/* Return non-zero if the inferior has some break/watchpoint that - triggered. */ - -static int -i386_stopped_by_hwbp (void) -{ - int i; - - dr_status_mirror = i386_dr_low.get_status (); - if (maint_show_dr) - i386_show_dr ("stopped_by_hwbp", 0, 0, hw_execute); - - ALL_DEBUG_REGISTERS(i) - { - if (I386_DR_WATCH_HIT (i)) - return 1; - } - - return 0; -} - /* Insert a hardware-assisted breakpoint at BP_TGT->placed_address. Return 0 on success, EBUSY on failure. */ static int --- a/gdb/testsuite/gdb.base/watchpoint-hw.exp +++ b/gdb/testsuite/gdb.base/watchpoint-hw.exp @@ -53,11 +53,27 @@ if ![runto_main] { gdb_test "rwatch watchee" -gdb_breakpoint [gdb_get_line_number "break-at-exit"] +set breakline [gdb_get_line_number "break-at-exit"] +gdb_breakpoint $breakline gdb_test "continue" "Continuing.\r\nHardware read watchpoint \[0-9\]+: watchee\r\n\r\nValue = 0\r\n.*" # Here should be no repeated notification of the read watchpoint. gdb_test "continue" \ "Continuing\\.\[ \r\n\]+Breakpoint \[0-9\]+, .*break-at-exit.*" \ - "continue to break-at-exit" + "continue to break-at-exit after rwatch" + +clean_restart ${test} + +if ![runto_main] { + untested ${test}.exp + return -1 +} + +gdb_test "hbreak ${srcfile}:${breakline}" \ + "Hardware assisted breakpoint 2 at 0x\[0-9a-f\]+: file .*${srcfile}, line ${breakline}\\." \ + "hbreak" + +gdb_test "continue" \ + "Continuing\\.\[ \r\n\]+Breakpoint \[0-9\]+, .*break-at-exit.*" \ + "continue to break-at-exit after hbreak"