From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129447 invoked by alias); 13 Mar 2015 14:41:43 -0000 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 Received: (qmail 129410 invoked by uid 89); 13 Mar 2015 14:41:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_FROM_URIBL_PCCC,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pa0-f49.google.com Received: from mail-pa0-f49.google.com (HELO mail-pa0-f49.google.com) (209.85.220.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 13 Mar 2015 14:41:38 +0000 Received: by paceu11 with SMTP id eu11so30045377pac.1 for ; Fri, 13 Mar 2015 07:41:36 -0700 (PDT) X-Received: by 10.70.33.3 with SMTP id n3mr69408271pdi.132.1426257696749; Fri, 13 Mar 2015 07:41:36 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id i6sm3924861pdm.4.2015.03.13.07.41.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Mar 2015 07:41:36 -0700 (PDT) From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 1/2] watchpoint-reuse-slot.exp: skip some tests on targets have different wp and bp registers Date: Fri, 13 Mar 2015 14:41:00 -0000 Message-Id: <1426257692-30461-1-git-send-email-qiyaoltc@gmail.com> X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00391.txt.bz2 From: Yao Qi watchpoint-reuse-slot.exp sets two hardware breakpoint and/or watchpoint, to test the same debugging register can be used correctly. However, on some targets, such as arm and aarch64, hardware has different registers for breakpoint and watchpoint, so don't have to do test if one breakpoint and one watchpoint are requested and target hardware has different debugging registers for breakpoint and watchpoint. gdb/testsuite: 2015-03-13 Yao Qi * gdb.base/watchpoint-reuse-slot.exp (dbg_registers_for_watch_and_break): New proc. (top level): Skip tests if breakpoint and watchpoint are requested and dbg_registers_for_watch_and_break returns false. --- gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp index 844bf3a..df6eeb6 100644 --- a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp +++ b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp @@ -157,6 +157,19 @@ proc watch_command {cmd base offset width} { } } +# Return true if the same debugging register can be used for both +# watchpoint and breakpoint. + +proc dbg_registers_for_watch_and_break {} { + if { [istarget "arm*-linux*"] || [istarget "aarch64*-*-linux*"] } { + # arm and aarch64 has different registers for watchpoint and + # breakpoint. + return 0 + } + + return 1 +} + # Run test proper. See intro for description. foreach always_inserted {"off" "on" } { @@ -171,6 +184,16 @@ foreach always_inserted {"off" "on" } { continue } + if {($cmd1 == "hbreak" && $cmd2 != "hbreak" + || $cmd1 != "hbreak" && $cmd2 == "hbreak") + && ![dbg_registers_for_watch_and_break]} { + # One breakpoint and watchpoint is requested, but + # different registers are used for breakpoint and + # watchpoint, then, the same slot can't be reused. + # Skip it. + continue + } + for {set x 0} {$x < 4} {incr x} { set prefix "always-inserted $always_inserted: " append prefix "$cmd1 x $cmd2: " -- 1.9.1