From patchwork Mon Nov 7 16:13:26 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: 60121 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 3A1943857835 for ; Mon, 7 Nov 2022 16:14:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3A1943857835 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667837669; bh=Sel1zO5yw4hrG+U87cPmGDEWD9vRF5TSCRXqKGNiOts=; 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=xN+Vo7yfmnQXhlGBb9GZd/xHKzBNk5G1wNGHqekfSR2jaVfdf/n341KtXviyfm/10 cSV70UsxLPqjVMygRhCy072+gg7Sv2dce5vCyRSVsaf7UfHFKEJrcBVMGGNGIe8eaB xMyief8gmvEkRcDr9sLJYvp+HR4azhmsxiY+GH1c= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id E46D83858D38 for ; Mon, 7 Nov 2022 16:13:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E46D83858D38 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 1983A22626 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 0340713494 for ; Mon, 7 Nov 2022 16:13:33 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id eDBdO60uaWPsTwAAMHmgww (envelope-from ) for ; Mon, 07 Nov 2022 16:13:33 +0000 To: gdb-patches@sourceware.org Subject: [PATCH 2/9] [gdb/testsuite] Fix gdb.base/info_sources_2.exp for remote target Date: Mon, 7 Nov 2022 17:13:26 +0100 Message-Id: <20221107161333.16999-3-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/info_sources_2.exp and target board remote-gdbserver-on-localhost (using REMOTE_TARGET_USERNAME) we run into some failures. Fix these by adding the missing gdb_load_shlib. Tested on x86_64-linux. --- gdb/testsuite/gdb.base/info_sources_2.exp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gdb/testsuite/gdb.base/info_sources_2.exp b/gdb/testsuite/gdb.base/info_sources_2.exp index f9246b8fa96..9fe3d479018 100644 --- a/gdb/testsuite/gdb.base/info_sources_2.exp +++ b/gdb/testsuite/gdb.base/info_sources_2.exp @@ -20,6 +20,8 @@ if { [skip_shlib_tests] } { return 0 } +set is_remote_target [is_remote target] + standard_testfile -test.c -lib.c set solib_name [standard_output_file ${testfile}-lib.so] @@ -37,6 +39,8 @@ if {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable \ clean_restart ${binfile} +set solib_name [gdb_load_shlib $solib_name] + if ![runto foo] { untested "failed to run to function foo" return -1 @@ -55,6 +59,7 @@ if ![runto foo] { # file is NOT listed for the given object file. proc run_info_sources { extra_args args } { global gdb_prompt srcdir subdir + global is_remote_target with_test_prefix "args: ${extra_args}" { @@ -76,6 +81,9 @@ proc run_info_sources { extra_args args } { -re "^(\[^\r\n\]+):\r\n" { set objfile_name $expect_out(1,string) + if { $is_remote_target } { + set objfile_name [file tail $objfile_name] + } exp_continue } @@ -129,6 +137,10 @@ proc run_info_sources { extra_args args } { # Figure out the path for SOURCEFILE that we're looking for. set sourcepath [file normalize ${srcdir}/${subdir}/${sourcefile}] + if { $is_remote_target } { + set objfile [file tail $objfile] + } + # Make sure we handle the case where there are no source files # associated with a particular objfile. set source_list {}