From patchwork Fri Apr 10 13:00:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 47041 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A66F121416 for ; Fri, 10 Apr 2015 13:01:14 +0000 (UTC) Received: by lbcne10 with SMTP id ne10sf4182130lbc.1 for ; Fri, 10 Apr 2015 06:01:13 -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=oBp/aPnbVm6J7A+96yrnAqLb/qe5d8D7p7+ZoCJsUjo=; b=PWErmTQYbUSkL5dAP2clbHkNTybIt0EgLRFEZqtCsubJE00hoSxadpopJG7Psf+RJF bqy8dMxaNnQapiLs2Qq7SfLz/wTt+VOhINb4Wyli9dz0fuSjONDhNIL+NgUktUzxML8z /OzyfB038d1nRxq0+Mq+muXBUKV9n+dNW9ivRHV3p0KC1fpxZ6DPR2TN7LhAMoVt67F3 INxVyjY5QnbHIhhGj2m6dDjyIIWifMzhq/YCANnNpRMve4X8myxoFOEXM8MSc4KPi0Y7 T03xXn0IE8lnSmLR+aGKAFBRwPYglrZWeHng8dvo4MwxhCssFGz4cD+/Q3PA7Vszmidw dTPw== X-Gm-Message-State: ALoCoQnCQ30wHA4foWCmEnHh0Q2eZdkb+qerqNzrTV4VbwP3y7kgcnbuuIjeTP4OongjmJR0IjR4 X-Received: by 10.112.118.162 with SMTP id kn2mr308383lbb.22.1428670873512; Fri, 10 Apr 2015 06:01:13 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.227 with SMTP id t3ls448787laj.72.gmail; Fri, 10 Apr 2015 06:01:13 -0700 (PDT) X-Received: by 10.152.5.170 with SMTP id t10mr1345173lat.43.1428670873372; Fri, 10 Apr 2015 06:01:13 -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 e4si1435305laf.74.2015.04.10.06.01.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Apr 2015 06:01:12 -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 layy10 with SMTP id y10so12699740lay.0 for ; Fri, 10 Apr 2015 06:01:12 -0700 (PDT) X-Received: by 10.152.87.204 with SMTP id ba12mr1378568lab.35.1428670872645; Fri, 10 Apr 2015 06:01:12 -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.67.65 with SMTP id l1csp1083671lbt; Fri, 10 Apr 2015 06:01:11 -0700 (PDT) X-Received: by 10.66.166.39 with SMTP id zd7mr2461456pab.117.1428670870757; Fri, 10 Apr 2015 06:01:10 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id dy2si2873733pbb.64.2015.04.10.06.01.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Apr 2015 06:01:10 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-return-121788-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 2458 invoked by alias); 10 Apr 2015 13:01:02 -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 2446 invoked by uid 89); 10 Apr 2015 13:01:02 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, NORMAL_HTTP_TO_IP, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f48.google.com Received: from mail-pa0-f48.google.com (HELO mail-pa0-f48.google.com) (209.85.220.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 10 Apr 2015 13:01:01 +0000 Received: by pabsx10 with SMTP id sx10so21099628pab.3 for ; Fri, 10 Apr 2015 06:00:59 -0700 (PDT) X-Received: by 10.66.228.130 with SMTP id si2mr2500746pac.92.1428670859402; Fri, 10 Apr 2015 06:00:59 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id rx3sm2233829pbc.78.2015.04.10.06.00.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Apr 2015 06:00:58 -0700 (PDT) From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH] [arm] watchpoint-reuse-slot.exp: skip setting HW points on some address Date: Fri, 10 Apr 2015 14:00:53 +0100 Message-Id: <1428670853-1336-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 Hi, ARM linux kernel has some requirements on the address/length setting for HW breakpoints/watchpoints, but watchpoint-reuse-slot.exp doesn't consider them and sets HW points on various addresses. Many fails are causes as a result: stepi^M Warning:^M Could not insert hardware watchpoint 20.^M Could not insert hardware breakpoints:^M You may have requested too many hardware breakpoints/watchpoints.^M ^M (gdb) FAIL: gdb.base/watchpoint-reuse-slot.exp: always-inserted off: watch x watch: : width 2, iter 2: base + 1: stepi advanced watch *(buf.byte + 2 + 1)@2^M Hardware watchpoint 388: *(buf.byte + 2 + 1)@2^M Warning:^M Could not insert hardware watchpoint 388.^M Could not insert hardware breakpoints:^M You may have requested too many hardware breakpoints/watchpoints.^M ^M (gdb) FAIL: gdb.base/watchpoint-reuse-slot.exp: always-inserted on: watch x watch: : width 2, iter 2: base + 1: watch *(buf.byte + 2 + 1)@2 This patch is to reflect kernel requirements in watchpoint-reuse-slot.exp in order to skip some tests. gdb/testsuite: 2015-04-10 Yao Qi * gdb.base/watchpoint-reuse-slot.exp (valid_addr_p): Return false for some offset and width combinations which aren't supported by linux kernel. --- gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp index 6d2c867..abe81d6 100644 --- a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp +++ b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp @@ -150,6 +150,33 @@ proc valid_addr_p {cmd offset width} { return 0 } } + } elseif { [istarget "arm*-*-linux*"] } { + if { $cmd == "hbreak" } { + # Breakpoints must be of length 2 (thumb) or 4 (ARM) bytes. + if { $width != 2 && $width != 4 } { + return 0 + } + } else { + # Watchpoints can be of length 1, 2, 4 or 8 bytes. + if { [expr $width % 2] != 0 } { + return 0 + } + } + + if { [expr ($offset) % 8] == 0 && $width == 8 } { + # If WIDTH is 8 byte, the address should be 8-byte aligned. + return 1 + } elseif { [expr ($offset) % 4] == 0 } { + return 1 + } elseif { [expr ($offset) % 4] == 2 && $width == 2 } { + # Halfword watchpoints and breakpoints. + return 1 + } elseif { [expr ($offset) % 4] == 1 && $width == 1 && $cmd != "hbreak" } { + # Single byte watchpoints. + return 1 + } else { + return 0 + } } return 1