This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix gdb.compile/compile.exp shlib regression


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9553661a5f8fb5f82846a04a02b7db8476d986e0

commit 9553661a5f8fb5f82846a04a02b7db8476d986e0
Author: Pedro Alves <palves@redhat.com>
Date:   Thu Apr 7 19:28:40 2016 +0100

    Fix gdb.compile/compile.exp shlib regression
    
    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]
    
    We were missing a gdb_load_shlibs call, which is needed for remote
    testing.
    
    gdb/testsuite/ChangeLog:
    2015-04-07  Pedro Alves  <palves@redhat.com>
    
    	* gdb.compile/compile.exp: Use gdb_compile with "shlib=" option
    	instead of build_executable.  Use gdb_load_shlibs.

Diff:
---
 gdb/testsuite/ChangeLog               |  5 +++++
 gdb/testsuite/gdb.compile/compile.exp | 10 +++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index e00afa7..53755fe 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-07  Pedro Alves  <palves@redhat.com>
+
+	* gdb.compile/compile.exp: Use gdb_compile with "shlib=" option
+	instead of build_executable.  Use gdb_load_shlibs.
+
 2016-04-07  Yao Qi  <yao.qi@linaro.org>
 
 	* gdb.reverse/finish-reverse-bkpt.exp: Use temporary breakpoint.
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
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]