* [pushed] [gdb/testsuite] Fix gdb.base/break-probes.exp for remote target
@ 2023-03-07 14:20 Tom de Vries
0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2023-03-07 14:20 UTC (permalink / raw)
To: gdb-patches
With test-case gdb.base/break-probes.exp and target board
remote-gdbserver-on-localhost (using REMOTE_TARGET_USERNAME) we run into some
failures.
Fix these by adding the missing gdb_download_shlib and gdb_locate_shlib.
Tested on x86_64-linux.
---
gdb/testsuite/gdb.base/break-probes.exp | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/gdb/testsuite/gdb.base/break-probes.exp b/gdb/testsuite/gdb.base/break-probes.exp
index 227e4f81c83..1d0612d1c66 100644
--- a/gdb/testsuite/gdb.base/break-probes.exp
+++ b/gdb/testsuite/gdb.base/break-probes.exp
@@ -26,11 +26,15 @@ if { [gdb_compile_shlib $srcfile_lib $binfile_lib {}] != "" } {
return -1
}
+set binfile_lib_target [gdb_download_shlib $binfile_lib]
+
if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
- [list debug shlib_load additional_flags=-DSHLIB_NAME=\"$binfile_lib\"]] } {
+ [list debug shlib_load additional_flags=-DSHLIB_NAME=\"$binfile_lib_target\"]] } {
return -1
}
+gdb_locate_shlib $binfile_lib
+
# Enable stop-on-solib-events
gdb_test_no_output "set stop-on-solib-events 1"
@@ -81,7 +85,9 @@ gdb_test_multiple $test $test {
# GDB strips "target:" from the start of filenames
# when operating on the local filesystem
-regsub "^target:" "$sysroot" "(target:)?" sysroot
+if { ![is_remote target] } {
+ regsub "^target:" "$sysroot" "(target:)?" sysroot
+}
# Run til it loads our library
set test "run til our library loads"
@@ -89,7 +95,7 @@ set not_loaded_library 1
while { $not_loaded_library } {
set not_loaded_library 0
gdb_test_multiple "c" $test {
- -re "Inferior loaded $sysroot$binfile_lib\\M.*$gdb_prompt $" {
+ -re "Inferior loaded $sysroot\[^\r\n\]*$binfile_lib_target\\M.*$gdb_prompt $" {
pass $test
}
-re "Stopped due to shared library event\\M.*$gdb_prompt $" {
base-commit: b7b7151da0535ce34a329c3e7648312cd2379b58
--
2.35.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-07 14:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-07 14:20 [pushed] [gdb/testsuite] Fix gdb.base/break-probes.exp for remote target Tom de Vries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).