From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 298F0385828D for ; Fri, 10 Mar 2023 15:34:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 298F0385828D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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 5BF3821F49 for ; Fri, 10 Mar 2023 15:34:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1678462475; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+okWb7KShetNCqYangHxHCNIUyGxbCsSxmxaM0lKbA0=; b=h3cxPu44RSrURF+azNV0udXyEfJrsz8/v7JKcTtObBeF07YgQfhwV08sDSP56Z0Wlj4Zxh XenUvFj4gGYLGm1pNegiuVKkubXzPra6H+IWRDb3qcIyNZ1TFXhI5F3mbYR9U2GAv2zuUT mspiLVdMlk7oPnQLsOuULzMHf2afpJI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1678462475; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+okWb7KShetNCqYangHxHCNIUyGxbCsSxmxaM0lKbA0=; b=76dEDYooujV6KeTkZ91uadJXmW7tb8a4/4RQprQSpN9yXLTpe5wusvxKQMg73LETSHUiWv EmCU31NBOs4yHXAw== 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 4858A134F7 for ; Fri, 10 Mar 2023 15:34:35 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id cNCQEAtOC2SxBwAAMHmgww (envelope-from ) for ; Fri, 10 Mar 2023 15:34:35 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [pushed 2/4] [gdb/testsuite] Fix py-autoloaded-pretty-printers-in-newobjfile-event.exp for remote target Date: Fri, 10 Mar 2023 16:34:31 +0100 Message-Id: <20230310153433.6265-2-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230310153433.6265-1-tdevries@suse.de> References: <20230310153433.6265-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.5 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 List-Id: With test-case gdb.python/py-autoloaded-pretty-printers-in-newobjfile-event.exp and target board remote-gdbserver-on-localhost, I run into: ... FAIL: $exp: runto: run to main ... I can easily fix this using "gdb_load_shlib $binfile_lib", but then run into: ... (gdb) print all_good^M $1 = false^M (gdb) FAIL: $exp: print all_good info pretty-printer^M ... Sysroot is set to "target:", so gdb downloads the shared library from the target (Using $so as shorthand for libpy-autoloaded-pretty-printers-in-newobjfile-event.so): ... Reading /home/remote-target/$so from remote target...^M ... and internally refers to it as "target:/home/remote-target/$so". In load_auto_scripts_for_objfile, gdb gives up trying to auto-load scripts for $so once it checks for is_target_filename. Fix this by declaring auto-load unsupported if sysroot starts with "target:". Tested on x86_64-linux. --- ...aded-pretty-printers-in-newobjfile-event.exp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gdb/testsuite/gdb.python/py-autoloaded-pretty-printers-in-newobjfile-event.exp b/gdb/testsuite/gdb.python/py-autoloaded-pretty-printers-in-newobjfile-event.exp index eefa99c8fa1..3f6d8199c46 100644 --- a/gdb/testsuite/gdb.python/py-autoloaded-pretty-printers-in-newobjfile-event.exp +++ b/gdb/testsuite/gdb.python/py-autoloaded-pretty-printers-in-newobjfile-event.exp @@ -60,11 +60,28 @@ set remote_python_event_handler_file\ gdb_test_no_output "source ${remote_python_event_handler_file}" "load python file" gdb_load ${binfile} +gdb_load_shlib $binfile_lib if { ![runto_main] } { return } +if { [is_remote target ] } { + set target_sysroot 0 + gdb_test_multiple "show sysroot" "" { + -re -wrap "\r\nThe current system root is \"target:.*\"\\." { + set target_sysroot 1 + } + -re -wrap "" { + } + } + + if { $target_sysroot } { + unsupported "sysroot start with target: -- auto-load not supported" + return + } +} + # Check that the new_objfile handler saw the pretty-printer. gdb_test "print all_good" " = true" -- 2.35.3