From patchwork Wed Nov 19 07:40:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 3800 Received: (qmail 19199 invoked by alias); 19 Nov 2014 07:40:44 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk 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 19185 invoked by uid 89); 19 Nov 2014 07:40:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 19 Nov 2014 07:40:39 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1XqzsR-0005IF-SR from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Tue, 18 Nov 2014 23:40:35 -0800 Received: from qiyao.dyndns.org.com (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.3.181.6; Tue, 18 Nov 2014 23:40:35 -0800 From: Yao Qi To: Subject: [PATCH] Match library name prefixed with sysroot Date: Wed, 19 Nov 2014 15:40:25 +0800 Message-ID: <1416382825-29407-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes We enable systemtap probe in glibc recently, and see the following gdb fail, (gdb) set solib-absolute-prefix /. ... Stopped due to shared library event:^M Inferior loaded /./foo/bar/gdb.base/break-probes-solib.so ... (gdb) FAIL: gdb.base/break-probes.exp: run til our library loads (the program exited) $binfile_lib is /foo/bar/gdb.base/break-probes-solib.so, but the sysroot is prefixed in solib.c:solib_find, as comments described: Global variable GDB_SYSROOT is used as a prefix directory to search for shared libraries if they have an absolute path. so the output becomes "/./foo/bar/gdb.base/break-probes-solib.so", which is still correct. However, the test repeatedly continue the program and tries to match $binfile_lib, finally, the program exits and the test fails. This patch is to adjust the pattern to match $sysroot$binfile_lib instead of $binfile_lib. gdb/testsuite: 2014-11-19 Yao Qi * gdb.base/break-probes.exp: Match library name prefixed with sysroot. --- gdb/testsuite/gdb.base/break-probes.exp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.base/break-probes.exp b/gdb/testsuite/gdb.base/break-probes.exp index e25ea91..77fe7326 100644 --- a/gdb/testsuite/gdb.base/break-probes.exp +++ b/gdb/testsuite/gdb.base/break-probes.exp @@ -58,13 +58,21 @@ gdb_test_multiple "bt" $test { } if { $using_probes } { + set sysroot "" + set test "show sysroot" + gdb_test_multiple $test $test { + -re "The current system root is \"(.*)\"\..*${gdb_prompt} $" { + set sysroot $expect_out(1,string) + } + } + # Run til it loads our library set test "run til our library loads" set not_loaded_library 1 while { $not_loaded_library } { set not_loaded_library 0 gdb_test_multiple "c" $test { - -re "Inferior loaded $binfile_lib\\M.*$gdb_prompt $" { + -re "Inferior loaded $sysroot$binfile_lib\\M.*$gdb_prompt $" { pass $test } -re "Stopped due to shared library event\\M.*$gdb_prompt $" {