From patchwork Wed Feb 25 15:08:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 45078 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E499E20502 for ; Wed, 25 Feb 2015 15:08:58 +0000 (UTC) Received: by wghk14 with SMTP id k14sf3340179wgh.0 for ; Wed, 25 Feb 2015 07:08:58 -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=gIaavpCAu+ixsLnKSWyRhykW2Tb/4YP5bP6PMtgL1Mo=; b=a23qLzh0UdBpvPGY1u63j7xtaBgtr4nK06Hn6TTPyMgA+waE+oAbB39OC6646lG13j rnTfv9x+r2gcuPxVfpTGGRPhmqrSvz4fuu7zVhQWZZm670iX0JIXffHv6THEhX/ShfBS j+yJ6tS/M+u9X/mhOvGF5wDw7GPJvPcWeQGzK5UNNlR/zBvGNWjzxhJ06GJv6jc8QkVn GcBafy0mUwQBIRa5vSx4enDJ9a7p7vA6nymwm3z14nAg7mxq+KbP/3TKD+clCXCgRYhR oM+WsN8kVFjnCEZs9+APq0Zm03sOFO2B1qN8/h3l6PjQIyoU5mWUeOHdpfLodOpEljrU hXPg== X-Gm-Message-State: ALoCoQn0BUFo4yzEQb5a00uPJvt/j/6ySFiey26OZi6RDyQTj/Hhf8BBTA7oGIFkN1N1T6cNGtwM X-Received: by 10.112.138.202 with SMTP id qs10mr538570lbb.24.1424876938164; Wed, 25 Feb 2015 07:08:58 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.167 with SMTP id an7ls301393lac.47.gmail; Wed, 25 Feb 2015 07:08:58 -0800 (PST) X-Received: by 10.112.132.101 with SMTP id ot5mr3166968lbb.30.1424876937898; Wed, 25 Feb 2015 07:08:57 -0800 (PST) Received: from mail-la0-x22a.google.com (mail-la0-x22a.google.com. [2a00:1450:4010:c03::22a]) by mx.google.com with ESMTPS id km14si20125677lbb.95.2015.02.25.07.08.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Feb 2015 07:08:57 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22a as permitted sender) client-ip=2a00:1450:4010:c03::22a; Received: by labgq15 with SMTP id gq15so4534094lab.3 for ; Wed, 25 Feb 2015 07:08:57 -0800 (PST) X-Received: by 10.112.204.197 with SMTP id la5mr3120910lbc.29.1424876937746; Wed, 25 Feb 2015 07:08:57 -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 h5csp2677510lbj; Wed, 25 Feb 2015 07:08:56 -0800 (PST) X-Received: by 10.66.254.105 with SMTP id ah9mr6261845pad.82.1424876936057; Wed, 25 Feb 2015 07:08:56 -0800 (PST) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id f12si25142pdm.155.2015.02.25.07.08.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Feb 2015 07:08:55 -0800 (PST) Received-SPF: pass (google.com: domain of gdb-patches-return-120199-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 44248 invoked by alias); 25 Feb 2015 15:08:21 -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 44200 invoked by uid 89); 25 Feb 2015 15:08:20 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f53.google.com Received: from mail-pa0-f53.google.com (HELO mail-pa0-f53.google.com) (209.85.220.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 25 Feb 2015 15:08:19 +0000 Received: by paceu11 with SMTP id eu11so5814218pac.10 for ; Wed, 25 Feb 2015 07:08:17 -0800 (PST) X-Received: by 10.70.43.38 with SMTP id t6mr4811534pdl.97.1424876897159; Wed, 25 Feb 2015 07:08:17 -0800 (PST) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id c8sm6264511pds.5.2015.02.25.07.08.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Feb 2015 07:08:16 -0800 (PST) From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH] Dwarf assembler: handle one instruction function Date: Wed, 25 Feb 2015 15:08:11 +0000 Message-Id: <1424876891-14475-1-git-send-email-yao.qi@linaro.org> X-Original-Sender: yao.qi@linaro.org 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::22a as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 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)