From patchwork Fri Apr 10 15:19:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 47054 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 B1B9E218D9 for ; Fri, 10 Apr 2015 15:20:26 +0000 (UTC) Received: by lbdc7 with SMTP id c7sf3159425lbd.2 for ; Fri, 10 Apr 2015 08:20:25 -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=EQppHzVBAZxUdw2cnM2BfnkdqJm68YRmAgMj7NZlvy8=; b=cS8OFz0FixCWB3sAW291Q7XrqLarZQGcIMnsrIpHCSZJAcsfmehHDS0ZOOzE+q9QTA MyNymK6Lj4Raj+/QVEDpbpV8kMViQ2yT+W2WIu19HYuU9+jHF3BLdQZiQJSG/+cmAkce wdpO2c74qQQskgodXJAl5NdLqFsGtPnnMhIPSB7Ph2XwzkbLLNgC3r5XQVhiKwr5z5ZG NTmVgZ9iwT56K6YLJefW4pUDq5CL+stDYo+QuEbac3NIurnRH0H4WiMymTtXhQY0ZGgW 9V6Bb64+F8ZIbreO2jcNj3BaahJ1wA2CJAUg6aN0pjF05QzfOiV1uDGwTMtRZn+24tAu DvAQ== X-Gm-Message-State: ALoCoQnLnTQOWP2WxTAlNlwhGQmocqixWizai1fsp5VZH5XymnQzGBKfrU+R0i0gQcvZnIfoGC+l X-Received: by 10.112.189.131 with SMTP id gi3mr405337lbc.6.1428679225605; Fri, 10 Apr 2015 08:20:25 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.172 with SMTP id p12ls473513lal.40.gmail; Fri, 10 Apr 2015 08:20:25 -0700 (PDT) X-Received: by 10.152.5.7 with SMTP id o7mr1867668lao.51.1428679225401; Fri, 10 Apr 2015 08:20:25 -0700 (PDT) Received: from mail-la0-x235.google.com (mail-la0-x235.google.com. [2a00:1450:4010:c03::235]) by mx.google.com with ESMTPS id lf11si1730337lac.24.2015.04.10.08.20.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Apr 2015 08:20:25 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::235 as permitted sender) client-ip=2a00:1450:4010:c03::235; Received: by layy10 with SMTP id y10so15703426lay.0 for ; Fri, 10 Apr 2015 08:20:25 -0700 (PDT) X-Received: by 10.112.184.70 with SMTP id es6mr1836647lbc.117.1428679225231; Fri, 10 Apr 2015 08:20:25 -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 l1csp1168721lbt; Fri, 10 Apr 2015 08:20:24 -0700 (PDT) X-Received: by 10.68.222.131 with SMTP id qm3mr3534104pbc.55.1428679223337; Fri, 10 Apr 2015 08:20:23 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id fk6si3396217pab.89.2015.04.10.08.20.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Apr 2015 08:20:23 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-return-121797-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 31396 invoked by alias); 10 Apr 2015 15:19:10 -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 31340 invoked by uid 89); 10 Apr 2015 15:19:10 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f176.google.com Received: from mail-pd0-f176.google.com (HELO mail-pd0-f176.google.com) (209.85.192.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 10 Apr 2015 15:19:09 +0000 Received: by pdbnk13 with SMTP id nk13so25756716pdb.0 for ; Fri, 10 Apr 2015 08:19:07 -0700 (PDT) X-Received: by 10.68.110.37 with SMTP id hx5mr3566779pbb.46.1428679147604; Fri, 10 Apr 2015 08:19:07 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id fz1sm2594212pbb.12.2015.04.10.08.19.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Apr 2015 08:19:07 -0700 (PDT) From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH] Fix fails in gdb.dwarf2/dynarr-ptr.exp Date: Fri, 10 Apr 2015 16:19:02 +0100 Message-Id: <1428679142-8236-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::235 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 I see many fails in gdb.dwarf2/dynarr-ptr.exp on arm-linux target, started from this print foo.three_ptr.all^M Cannot access memory at address 0x107c8^M (gdb) FAIL: gdb.dwarf2/dynarr-ptr.exp: print foo.three_ptr.all print foo.three_ptr.all(1)^M Cannot access memory at address 0x107c8 It turns out that ":$ptr_size" is used incorrectly. array_ptr_label: DW_TAG_pointer_type { {DW_AT_byte_size :$ptr_size } ^^^^^^^^^^ {DW_AT_type :$array_label} } Since the FORM isn't given, and it starts with the ":", it is regarded as a label reference by dwarf assembler. The generated asm file on x86_64 is .uleb128 6 /* Abbrev (DW_TAG_pointer_type) */ .4byte 8 - .Lcu1_begin <----- WRONG .4byte .Llabel2 - .Lcu1_begin Looks .Lcu1_begin is 0 on x86_64 and that is why this test passes on x86_64. On arm, .Lcu1_begin is an address somewhere, and the value of DW_AT_byte_size is a very large number, so memory read request of such large length failed. This patch is to remove ":" and set the form explicitly. The generated asm file on x86_64 becomes .uleb128 6 /* Abbrev (DW_TAG_pointer_type) */ .byte 8 .4byte .Llabel2 - .Lcu1_begin gdb/testsuite: 2015-04-10 Yao Qi * gdb.dwarf2/dynarr-ptr.exp (assemble): Use $ptr_size instead of ":$ptr_size" and set its form explicitly. --- gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp b/gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp index 544509b..3dcb3d7 100644 --- a/gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp +++ b/gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp @@ -74,7 +74,7 @@ Dwarf::assemble $asm_file { } } array_ptr_label: DW_TAG_pointer_type { - {DW_AT_byte_size :$ptr_size } + {DW_AT_byte_size $ptr_size DW_FORM_data1} {DW_AT_type :$array_label} } array_typedef_label: DW_TAG_typedef {