From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id E65FF3896C16; Tue, 15 Nov 2022 14:25:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E65FF3896C16 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668522340; bh=ZZ9QdQg+E2yKCNlOaqkaP+snZDGdyPukAk6UaN89AFU=; h=From:To:Subject:Date:From; b=KkqVQSZcRWHYt6Hym26FWlAlL5clOAiYREbMp4K8D43IonyS15kqGL20kGC5oaAjf GODxugiGKG27Pd4EX0liviHHunkhzCX2PMmNt2E3qKhFJEIR9sc51hLPFSIcrpeo1i QeFAGSbndjbaNri3EaktY3LvjTyXriIZo7j779cU= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Fix gdb.base/jit-elf-so.exp for remote target X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 32e0d36918d0acaafba8940327a2ba12c96ac534 X-Git-Newrev: 7642de570f32bf901f397c419172cd2ab863ebc6 Message-Id: <20221115142540.E65FF3896C16@sourceware.org> Date: Tue, 15 Nov 2022 14:25:40 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D7642de570f32= bf901f397c419172cd2ab863ebc6 commit 7642de570f32bf901f397c419172cd2ab863ebc6 Author: Tom de Vries Date: Tue Nov 15 15:24:54 2022 +0100 [gdb/testsuite] Fix gdb.base/jit-elf-so.exp for remote target =20 With test-case gdb.base/jit-elf-so.exp and target board remote-gdbserver-on-localhost (using REMOTE_TARGET_USERNAME) we run int= o some failures. =20 Fix these by: - setting jit_libname with the name as returned by gdb_load_shlib - allowing the libraries to be prefixed with the remote target director= y. =20 Tested on x86_64-linux. =20 Co-Authored-by: Ivan Tetyushkin Diff: --- gdb/testsuite/gdb.base/jit-elf-so.exp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/gdb.base/jit-elf-so.exp b/gdb/testsuite/gdb.base= /jit-elf-so.exp index dcc9afc36b9..d5f56600701 100644 --- a/gdb/testsuite/gdb.base/jit-elf-so.exp +++ b/gdb/testsuite/gdb.base/jit-elf-so.exp @@ -73,10 +73,10 @@ proc one_jit_test {solib_binfiles_target match_str} { with_test_prefix "one_jit_test-$count" { global test_verbose global main_loader_binfile main_loader_srcfile - global main_solib_binfile main_solib_srcfile + global main_solib_binfile main_solib_binfile_target main_solib_srcfile =20 clean_restart $main_loader_binfile - gdb_load_shlib $main_solib_binfile + gdb_locate_shlib $main_solib_binfile =20 # This is just to help debugging when things fail if {$test_verbose > 0} { @@ -90,7 +90,7 @@ proc one_jit_test {solib_binfiles_target match_str} { gdb_breakpoint [gdb_get_line_number "break here before-dlopen" \ $main_loader_srcfile] gdb_continue_to_breakpoint "break here before-dlopen" - gdb_test_no_output "set var jit_libname =3D \"$main_solib_binfile\"" \ + gdb_test_no_output "set var jit_libname =3D \"$main_solib_binfile_target\= "" \ "setting library name" =20 gdb_breakpoint [gdb_get_line_number "break here after-dlopen" \ @@ -140,6 +140,9 @@ if { [compile_jit_elf_main_as_so $main_solib_srcfile $m= ain_solib_binfile \ return } =20 +set main_solib_binfile_target \ + [gdb_download_shlib $main_solib_binfile] + # Compile the "real" main for this test. if { [compile_jit_dlmain {shlib_load}] < 0 } { return @@ -161,6 +164,6 @@ foreach solib $jit_solibs_target { set input [string range $solib 0 [expr { [string length $solib] - 2 }]] gdb_test \ "complete jit-reader-load [standard_output_file $input]" \ - "jit-reader-load $solib" \ + "jit-reader-load \[^\r\n\]*$solib" \ "test jit-reader-load filename completion [file tail $solib]" }