This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
break-interp.exp, and attaching with no file loaded
- From: Pedro Alves <palves at redhat dot com>
- To: GDB Patches <gdb-patches at sourceware dot org>, Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Date: Fri, 27 Jan 2012 19:37:22 +0000
- Subject: break-interp.exp, and attaching with no file loaded
The testfile contains tests where gdb attaches to a process without
loading a file, and so with extend-remote gdbserver, given that gdb can't figure
out automatically what was the executable, things fall apart. Jan, is there a
reason the test can't be changed to always have gdb load the executable? I don't
pretend to understand most of this test yet.
With the hacks below, break-interp.exp passes cleanly against a local
extended-remote gdbserver.
--
Pedro Alves
diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp
index 04b5eab..dfdc4bb 100644
--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -272,6 +272,10 @@ proc test_attach_gdb {file pid displacement prefix} {
# Missing "$gdb_prompt $" is intentional.
pass $test
}
+ -re "Attached to process $pid\r\n" {
+ # Missing "$gdb_prompt $" is intentional.
+ pass $test
+ }
}
set test "attach final prompt"
@@ -336,7 +340,8 @@ proc test_attach {file displacement {relink_args ""}} {
}
if {$relink_args == ""} {
- test_attach_gdb "" $pid $displacement "attach"
+ global exec
+ test_attach_gdb $exec $pid $displacement "attach"
} else {
# These could be rather passed as arguments.
global exec interp_saved interp
@@ -447,6 +452,8 @@ proc test_ld {file ifmain trynosym displacement} {
# Test no (error) message has been printed by `exec-file'.
set escapedfile [string_to_regexp $file]
gdb_test "exec-file $file" "exec-file $escapedfile" "load"
+ # Needs abstraction
+ gdb_test "set remote exec-file $file" "exec-file $escapedfile" "remote load"
if $ifmain {
reach "_dl_debug_state" run $displacement