From patchwork Fri Mar 13 14:41:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 45778 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7159F214CB for ; Fri, 13 Mar 2015 14:41:55 +0000 (UTC) Received: by lbiz11 with SMTP id z11sf17113698lbi.2 for ; Fri, 13 Mar 2015 07:41:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:mailing-list :precedence:list-id:list-unsubscribe:list-subscribe:list-archive :list-post:list-help:sender:delivered-to:from:to:subject:date :message-id:x-original-sender:x-original-authentication-results; bh=YqmtgTudf25TW/+fSF+OwmRTwoKHIuHuzL+N3Bupr5Q=; b=DiNNAbkgZOxY4Ctp+7PAzGQnvcc/Cuj9cVvoXOy4y8PtfYxC4vCjVy0LcN4uBZOQoi B3D0gFwRB7b1E4U/V64EHKE7It609CHwDmtKMIMN84ru42Bs8kyB8+kfQsZJbyQkS7vd TB3vtTlP9Yo4BPxEVlRS5x9dyAc7jSkpD/kyvoChmkWBxo9ECaDXZ5zaV9l30pARrdyf HZLrubrfT3xPj+PWZOSNNYuaxZfn7GgrIR+vYy5VB3rtBiLq+NeebyUg2tuhqgMh9+O/ uGBr6Nt9sJCWpTC1x57nmpsmXInae72UPYUo9Y14syT3tbn76XQ/fD4zlNQnpg/Eu33L rzWw== X-Gm-Message-State: ALoCoQn8qBv4rpFwI9ePaQhAD9P0tTLFiRaIJk+D7Zk27F+f2vVswgeqOLoqv3S/0MJ8fRQCRYuT X-Received: by 10.112.40.81 with SMTP id v17mr3383827lbk.5.1426257714535; Fri, 13 Mar 2015 07:41:54 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.169 with SMTP id s9ls430950laa.8.gmail; Fri, 13 Mar 2015 07:41:54 -0700 (PDT) X-Received: by 10.112.173.41 with SMTP id bh9mr42975234lbc.107.1426257714256; Fri, 13 Mar 2015 07:41:54 -0700 (PDT) Received: from mail-la0-x231.google.com (mail-la0-x231.google.com. [2a00:1450:4010:c03::231]) by mx.google.com with ESMTPS id lm12si1511492lac.175.2015.03.13.07.41.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Mar 2015 07:41:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::231 as permitted sender) client-ip=2a00:1450:4010:c03::231; Received: by labgm9 with SMTP id gm9so23035440lab.13 for ; Fri, 13 Mar 2015 07:41:54 -0700 (PDT) X-Received: by 10.112.130.100 with SMTP id od4mr20956775lbb.86.1426257714102; Fri, 13 Mar 2015 07:41:54 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp958635lbj; Fri, 13 Mar 2015 07:41:53 -0700 (PDT) X-Received: by 10.70.103.101 with SMTP id fv5mr101852322pdb.5.1426257712000; Fri, 13 Mar 2015 07:41:52 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id y4si4427123pas.78.2015.03.13.07.41.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Mar 2015 07:41:51 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-return-120727-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 129447 invoked by alias); 13 Mar 2015 14:41:43 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list List-Id: List-Unsubscribe: , List-Subscribe: List-Archive: List-Post: , List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 129410 invoked by uid 89); 13 Mar 2015 14:41:39 -0000 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:31 +0000 Message-Id: <1426257692-30461-1-git-send-email-qiyaoltc@gmail.com> X-IsSubscribed: yes X-Original-Sender: qiyaoltc@gmail.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::231 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com X-Google-Group-Id: 836684582541 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: "