From patchwork Mon Nov 7 16:13:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 60124 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 256CA3857BAE for ; Mon, 7 Nov 2022 16:14:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 256CA3857BAE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667837694; bh=9pFF9TeGLcm8vdN004gE8U19yGaXEnAyZHSThtQ3ztc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=mSi7P+9jiyexqr34/jt0gMWD+OJpLZ82ZsCRWLGwtKZkOBSpiIijY2MbgWqG3fTX4 xLecgSQcB2kNm/JSiDuWWi4yPRL3pYa/iTDOS6nRlPEj6Ei0Bu42cyI9Petw0KcUAW IfXt047bKsmhHWf2gTRLNzsITy2NN9pwLwqc1nGo= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 55DF03858C39 for ; Mon, 7 Nov 2022 16:13:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 55DF03858C39 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C2B212262B for ; Mon, 7 Nov 2022 16:13:34 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id AFD1413494 for ; Mon, 7 Nov 2022 16:13:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id AG7CKa4uaWPsTwAAMHmgww (envelope-from ) for ; Mon, 07 Nov 2022 16:13:34 +0000 To: gdb-patches@sourceware.org Subject: [PATCH 9/9] [gdb/testsuite] Fix gdb.base/jit-elf-so.exp for remote target Date: Mon, 7 Nov 2022 17:13:33 +0100 Message-Id: <20221107161333.16999-10-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20221107161333.16999-1-tdevries@suse.de> References: <20221107161333.16999-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" With test-case gdb.base/jit-elf-so.exp and target board remote-gdbserver-on-localhost (using REMOTE_TARGET_USERNAME) we run into some failures. 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 directory. Tested on x86_64-linux. Co-Authored-by: Ivan Tetyushkin --- 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 clean_restart $main_loader_binfile - gdb_load_shlib $main_solib_binfile + gdb_locate_shlib $main_solib_binfile # 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 = \"$main_solib_binfile\"" \ + gdb_test_no_output "set var jit_libname = \"$main_solib_binfile_target\"" \ "setting library name" gdb_breakpoint [gdb_get_line_number "break here after-dlopen" \ @@ -140,6 +140,9 @@ if { [compile_jit_elf_main_as_so $main_solib_srcfile $main_solib_binfile \ return } +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]" }