From patchwork Fri Aug 5 13:59:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Weigand X-Patchwork-Id: 3287 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 67E3323F46 for ; Fri, 5 Aug 2011 13:59:26 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id F0BEBA184A3 for ; Fri, 5 Aug 2011 13:59:25 +0000 (UTC) Received: by qwb8 with SMTP id 8so1805781qwb.11 for ; Fri, 05 Aug 2011 06:59:25 -0700 (PDT) Received: by 10.229.44.195 with SMTP id b3mr1796510qcf.7.1312552765151; Fri, 05 Aug 2011 06:59:25 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.6.73 with SMTP id 9cs49480qcy; Fri, 5 Aug 2011 06:59:24 -0700 (PDT) Received: by 10.216.168.16 with SMTP id j16mr1902998wel.10.1312552763722; Fri, 05 Aug 2011 06:59:23 -0700 (PDT) Received: from mtagate3.uk.ibm.com (mtagate3.uk.ibm.com [194.196.100.163]) by mx.google.com with ESMTPS id m76si6264677weq.112.2011.08.05.06.59.23 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 05 Aug 2011 06:59:23 -0700 (PDT) Received-SPF: pass (google.com: domain of uweigand@de.ibm.com designates 194.196.100.163 as permitted sender) client-ip=194.196.100.163; Authentication-Results: mx.google.com; spf=pass (google.com: domain of uweigand@de.ibm.com designates 194.196.100.163 as permitted sender) smtp.mail=uweigand@de.ibm.com Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p75DxMTc022690 for ; Fri, 5 Aug 2011 13:59:22 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p75DxMwi2187280 for ; Fri, 5 Aug 2011 14:59:22 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p75DxMPO029137 for ; Fri, 5 Aug 2011 07:59:22 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id p75DxK7k029080 for ; Fri, 5 Aug 2011 07:59:21 -0600 Message-Id: <201108051359.p75DxK7k029080@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 05 Aug 2011 15:59:20 +0200 Subject: [commit] Fix dlopen tests for remote execution (fwd) To: patches@linaro.org Date: Fri, 5 Aug 2011 15:59:20 +0200 (CEST) From: "Ulrich Weigand" X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 http://sourceware.org/ml/gdb-patches/2011-08/msg00068.html ChangeLog: * gdb.base/jit.exp: Download solib_binfile to target. * gdb.base/jit-so.exp: Likewise. Also, use gdb_load_shlibs and call dlopen without full path name. * gdb.cp/infcall-dlopen.exp: Use gdb_load_shlibs and call dlopen without full path name. Index: gdb/testsuite/gdb.base/jit-so.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/jit-so.exp,v retrieving revision 1.1 diff -u -p -r1.1 jit-so.exp --- gdb/testsuite/gdb.base/jit-so.exp 6 Jul 2011 21:40:17 -0000 1.1 +++ gdb/testsuite/gdb.base/jit-so.exp 4 Aug 2011 11:47:59 -0000 @@ -46,6 +46,7 @@ if { [gdb_compile "${srcdir}/${subdir}/ set testfile2 jit-main set srcfile2 ${testfile2}.c set binfile2 ${objdir}/${subdir}/${testfile2}.so +set binfile2_dlopen [shlib_target_file ${testfile2}.so] if { [gdb_compile_shlib "${srcdir}/${subdir}/${srcfile2}" ${binfile2} {debug additional_flags="-DMAIN=jit_dl_main"}] != "" } { untested jit.exp return -1 @@ -54,7 +55,7 @@ if { [gdb_compile_shlib "${srcdir}/${sub set solib_testfile "jit-solib" set solib_srcfile "${srcdir}/${subdir}/${solib_testfile}.c" set solib_binfile "${objdir}/${subdir}/${solib_testfile}.so" -set solib_binfile_test_msg "OBJDIR/${subdir}/${solib_testfile}.so" +set solib_binfile_test_msg "SHLIBDIR/${solib_testfile}.so" # Note: compiling without debug info: the library goes through symbol # renaming by munging on its symbol table, and that wouldn't work for .debug @@ -64,13 +65,16 @@ if { [gdb_compile_shlib ${solib_srcfile} return -1 } +set solib_binfile_target [gdb_download ${solib_binfile}] + proc one_jit_test {count match_str} { - global verbose testfile srcfile2 binfile2 solib_binfile solib_binfile_test_msg pf_prefix + global verbose testfile srcfile2 binfile2 binfile2_dlopen solib_binfile_target solib_binfile_test_msg pf_prefix set old_pf_prefix $pf_prefix set pf_prefix "one_jit_test-$count" clean_restart $testfile + gdb_load_shlibs $binfile2 # This is just to help debugging when things fail if {$verbose > 0} { @@ -86,7 +90,7 @@ proc one_jit_test {count match_str} { gdb_continue_to_breakpoint "break here before-dlopen" # Poke desired values directly into inferior instead of using "set args" # because "set args" does not work under gdbserver. - gdb_test_no_output "set var jit_libname = \"$binfile2\"" + gdb_test_no_output "set var jit_libname = \"$binfile2_dlopen\"" gdb_breakpoint [gdb_get_line_number "break here after-dlopen" ] gdb_continue_to_breakpoint "break here after-dlopen" @@ -95,7 +99,7 @@ proc one_jit_test {count match_str} { gdb_continue_to_breakpoint "break here 0" gdb_test_no_output "set var argc = 2" - gdb_test_no_output "set var libname = \"$solib_binfile\"" "set var libname = \"$solib_binfile_test_msg\"" + gdb_test_no_output "set var libname = \"$solib_binfile_target\"" "set var libname = \"$solib_binfile_test_msg\"" gdb_test_no_output "set var count = $count" gdb_breakpoint "$srcfile2:[gdb_get_line_number {break here 1} $srcfile2]" Index: gdb/testsuite/gdb.base/jit.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/jit.exp,v retrieving revision 1.2 diff -u -p -r1.2 jit.exp --- gdb/testsuite/gdb.base/jit.exp 7 Feb 2011 13:35:42 -0000 1.2 +++ gdb/testsuite/gdb.base/jit.exp 4 Aug 2011 11:47:59 -0000 @@ -43,7 +43,7 @@ if { [gdb_compile "${srcdir}/${subdir}/ set solib_testfile "jit-solib" set solib_srcfile "${srcdir}/${subdir}/${solib_testfile}.c" set solib_binfile "${objdir}/${subdir}/${solib_testfile}.so" -set solib_binfile_test_msg "OBJDIR/${subdir}/${solib_testfile}.so" +set solib_binfile_test_msg "SHLIBDIR/${solib_testfile}.so" # Note: compiling without debug info: the library goes through symbol # renaming by munging on its symbol table, and that wouldn't work for .debug @@ -53,8 +53,10 @@ if { [gdb_compile_shlib ${solib_srcfile} return -1 } +set solib_binfile_target [gdb_download ${solib_binfile}] + proc one_jit_test {count match_str} { - global verbose testfile solib_binfile solib_binfile_test_msg pf_prefix + global verbose testfile solib_binfile_target solib_binfile_test_msg pf_prefix set old_pf_prefix $pf_prefix set pf_prefix "one_jit_test-$count" @@ -77,7 +79,7 @@ proc one_jit_test {count match_str} { # Poke desired values directly into inferior instead of using "set args" # because "set args" does not work under gdbserver. gdb_test_no_output "set var argc = 2" - gdb_test_no_output "set var libname = \"$solib_binfile\"" "set var libname = \"$solib_binfile_test_msg\"" + gdb_test_no_output "set var libname = \"$solib_binfile_target\"" "set var libname = \"$solib_binfile_test_msg\"" gdb_test_no_output "set var count = $count" gdb_breakpoint [gdb_get_line_number "break here 1"] Index: gdb/testsuite/gdb.cp/infcall-dlopen.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/infcall-dlopen.exp,v retrieving revision 1.2 diff -u -p -r1.2 infcall-dlopen.exp --- gdb/testsuite/gdb.cp/infcall-dlopen.exp 1 Jan 2011 15:33:43 -0000 1.2 +++ gdb/testsuite/gdb.cp/infcall-dlopen.exp 4 Aug 2011 11:47:59 -0000 @@ -27,6 +27,7 @@ set srclibfile ${testfile}-lib.cc set executable ${testfile} set libfile ${objdir}/${subdir}/${executable}.so set binfile ${objdir}/${subdir}/${executable} +set lib_dlopen [shlib_target_file ${executable}.so] # Use completely arbitrary file for $libfile source. if { [gdb_compile_shlib ${srcdir}/${subdir}/${srclibfile} ${libfile} {debug c++}] != "" @@ -34,12 +35,14 @@ if { [gdb_compile_shlib ${srcdir}/${subd return -1 } +gdb_load_shlibs $libfile + if { ![runto_main] } { return -1 } for {set i 0} {$i < 10} {incr i} { - gdb_test "p openlib (\"${libfile}\")" " = 1" "test $i" + gdb_test "p openlib (\"${lib_dlopen}\")" " = 1" "test $i" # Try to exploit the GDB trashed memory. gdb_test "b openlib" {Breakpoint [0-9]+ at .*} "test $i stub 1" gdb_test_no_output {delete $bpnum} "test $i stub 2"