From patchwork Wed Feb 25 15:16:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 45079 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C656420502 for ; Wed, 25 Feb 2015 15:16:35 +0000 (UTC) Received: by labgm9 with SMTP id gm9sf3393726lab.2 for ; Wed, 25 Feb 2015 07:16:34 -0800 (PST) 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=I09Y2BG5SgiRzX8EDBClibrMKEYa8FU5QHQbrmunNmE=; b=XQTH2fjqY60X7WEBXYmVqJIR8x1EbEi99AJWF8qWupjGwgMXWyq90/QD5roi8MFtvF qhhYQLbX6wCEjlN6VZ8UNGeJRelyA5M8UedpnFSW8Br/KvRfDKuWtgeGzxXPPBo3oLM9 7YStOQ/T17+1P6ZjK48mDX+qj3TsFJYIPMngIDv0Ue+drTZBBEkYoxiW0jR03bTK0UYE IY6s3avB4X4ZKssn7ZGbIKctEqSDHfCKARGmBquIvn7bIu/Eopi8rQCRuSqv8qKfBkKw I2VqAqefrHy2jbGuFgC2Mq7o1Heo9ofsnKRV1o9NEpYn6h0tYueTkiCQuuWbU8bMVoVw XmEA== X-Gm-Message-State: ALoCoQkLzDDuvpb7FU28SnkVCl8Wva/Mjt1EyzBxzktLMTwFMZMJElGBRITjXsWPXXua7I5PvHjG X-Received: by 10.112.161.9 with SMTP id xo9mr570531lbb.7.1424877394637; Wed, 25 Feb 2015 07:16:34 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.9 with SMTP id bc9ls891139lab.101.gmail; Wed, 25 Feb 2015 07:16:34 -0800 (PST) X-Received: by 10.152.45.37 with SMTP id j5mr3231050lam.31.1424877394498; Wed, 25 Feb 2015 07:16:34 -0800 (PST) Received: from mail-lb0-x235.google.com (mail-lb0-x235.google.com. [2a00:1450:4010:c04::235]) by mx.google.com with ESMTPS id pd6si24433523lbc.13.2015.02.25.07.16.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Feb 2015 07:16:34 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::235 as permitted sender) client-ip=2a00:1450:4010:c04::235; Received: by lbiz11 with SMTP id z11so4494608lbi.8 for ; Wed, 25 Feb 2015 07:16:34 -0800 (PST) X-Received: by 10.112.57.139 with SMTP id i11mr3248199lbq.106.1424877394054; Wed, 25 Feb 2015 07:16:34 -0800 (PST) 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 h5csp2682463lbj; Wed, 25 Feb 2015 07:16:33 -0800 (PST) X-Received: by 10.70.124.138 with SMTP id mi10mr6340008pdb.23.1424877391948; Wed, 25 Feb 2015 07:16:31 -0800 (PST) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id f6si1285354pdn.231.2015.02.25.07.16.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Feb 2015 07:16:31 -0800 (PST) Received-SPF: pass (google.com: domain of gdb-patches-return-120200-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 69581 invoked by alias); 25 Feb 2015 15:16:23 -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 69565 invoked by uid 89); 25 Feb 2015 15:16:23 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.2 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-pd0-f180.google.com Received: from mail-pd0-f180.google.com (HELO mail-pd0-f180.google.com) (209.85.192.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 25 Feb 2015 15:16:22 +0000 Received: by pdbnh10 with SMTP id nh10so5455937pdb.11 for ; Wed, 25 Feb 2015 07:16:20 -0800 (PST) X-Received: by 10.69.16.99 with SMTP id fv3mr6237701pbd.98.1424877380054; Wed, 25 Feb 2015 07:16:20 -0800 (PST) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id pp9sm41549084pbb.65.2015.02.25.07.16.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Feb 2015 07:16:19 -0800 (PST) From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH] Dwarf assembler: handle one instruction function Date: Wed, 25 Feb 2015 15:16:15 +0000 Message-Id: <1424877375-14752-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:c04::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 On aarch64, we got the following fail: (gdb) disassemble func Dump of assembler code for function func: 0x0000000000400730 <+0>: ret End of assembler dump.^M (gdb) x/2i func+0^M 0x400730 : ret^M 0x400734
: stp x29, x30, [sp,#-16]!^M (gdb) FAIL: gdb.dwarf2/dw2-ifort-parameter.exp: x/2i func+0 the pattern in proc function_range expects to match , however, GDB doesn't display the offset when it is zero. This patch is to adjust the pattern when $func_length. gdb/testsuite: 2015-02-25 Yao Qi * lib/dwarf.exp (function_range): Adjust pattern when $func_length is zero. --- gdb/testsuite/lib/dwarf.exp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp index 8ea7a0f..19963c4 100644 --- a/gdb/testsuite/lib/dwarf.exp +++ b/gdb/testsuite/lib/dwarf.exp @@ -146,9 +146,14 @@ proc function_range { func src } { } # Compute the size of the last instruction. + if { $func_length == 0 } then { + set func_pattern "$func" + } else { + set func_pattern "$func\\+$func_length" + } set test "x/2i $func+$func_length" gdb_test_multiple $test $test { - -re ".*($hex) <$func\\+$func_length>:\[^\r\n\]+\r\n\[ \]+($hex).*\.\r\n$gdb_prompt $" { + -re ".*($hex) <$func_pattern>:\[^\r\n\]+\r\n\[ \]+($hex).*\.\r\n$gdb_prompt $" { set start $expect_out(1,string) set end $expect_out(2,string)