aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-autoloaded-pretty-printers-in-newobjfile-event.exp
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-03-10 16:34:04 +0100
committerTom de Vries <tdevries@suse.de>2023-03-10 16:34:04 +0100
commitddc003b7ded07645cec7d14284ea317b29c8c336 (patch)
treea322999a946c5f8f787df20ee772fac2e3763d0d /gdb/testsuite/gdb.python/py-autoloaded-pretty-printers-in-newobjfile-event.exp
parent69b956fbe93e5283d8145edf4c86fde827a77c7b (diff)
downloadbinutils-ddc003b7ded07645cec7d14284ea317b29c8c336.zip
binutils-ddc003b7ded07645cec7d14284ea317b29c8c336.tar.gz
binutils-ddc003b7ded07645cec7d14284ea317b29c8c336.tar.bz2
[gdb/testsuite] Fix py-autoloaded-pretty-printers-in-newobjfile-event.exp for remote target
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.
Diffstat (limited to 'gdb/testsuite/gdb.python/py-autoloaded-pretty-printers-in-newobjfile-event.exp')
-rw-r--r--gdb/testsuite/gdb.python/py-autoloaded-pretty-printers-in-newobjfile-event.exp17
1 files changed, 17 insertions, 0 deletions
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 eefa99c..3f6d819 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"