From patchwork Wed Apr 6 23:06:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 11658 Received: (qmail 83834 invoked by alias); 6 Apr 2016 23:06:26 -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 83824 invoked by uid 89); 6 Apr 2016 23:06:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=disappear, Inferior X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 06 Apr 2016 23:06:24 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 621B480F6C; Wed, 6 Apr 2016 23:06:23 +0000 (UTC) Received: from cascais.lan (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u36N6Lqv008574; Wed, 6 Apr 2016 19:06:22 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH] Fix gdb.compile/compile.exp shlib regression Date: Thu, 7 Apr 2016 00:06:21 +0100 Message-Id: <1459983981-19198-1-git-send-email-palves@redhat.com> Commit 6e774b13c3b8 (Make ftrace tests work with remote targets) made a few gdb.compile/compile.exp tests disappear: -PASS: gdb.compile/compile.exp: call shared library function -PASS: gdb.compile/compile.exp: expect 1 -PASS: gdb.compile/compile.exp: modify shared library variable -PASS: gdb.compile/compile.exp: expect 15 This is because the test uses ldflags instead of using the shlib option, so it misses linking with -rpath, resulting in: (gdb) run Starting program: .../compile/compile-shlib .../compile/compile-shlib: error while loading shared libraries: compile-shlib.so: cannot open shared object file: No such file or directory [Inferior 1 (process 18014) exited with code 0177] I also noticed we were missing a gdb_load_shlibs call. gdb/testsuite/ChangeLog: yyyy-mm-dd Pedro Alves * gdb.compile/compile.exp: Use gdb_compile with "shlib=" option instead of build_executable. Use gdb_load_shlibs. --- gdb/testsuite/gdb.compile/compile.exp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.compile/compile.exp b/gdb/testsuite/gdb.compile/compile.exp index 07a7568..a8bfc24 100644 --- a/gdb/testsuite/gdb.compile/compile.exp +++ b/gdb/testsuite/gdb.compile/compile.exp @@ -362,13 +362,17 @@ if {[skip_shlib_tests]} { } set libbin [standard_output_file ${testfile}-shlib.so] +set binfile [standard_output_file ${testfile}-shlib] + if { [gdb_compile_shlib ${srcdir}/${subdir}/${srcfile2} $libbin {debug}] != "" - || [build_executable $testfile ${testfile}-shlib $srcfile \ - [list debug ldflags=$libbin]] == -1 } { + || [gdb_compile ${srcdir}/${subdir}/${srcfile} $binfile executable \ + [list debug shlib=$libbin]] == -1 } { return -1 } -clean_restart ${testfile}-shlib +clean_restart $binfile +gdb_load_shlibs $libbin + if ![runto_main] { return -1 }