aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/pie-execl.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base/pie-execl.exp')
-rw-r--r--gdb/testsuite/gdb.base/pie-execl.exp24
1 files changed, 22 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.base/pie-execl.exp b/gdb/testsuite/gdb.base/pie-execl.exp
index 182f96f..51edc82 100644
--- a/gdb/testsuite/gdb.base/pie-execl.exp
+++ b/gdb/testsuite/gdb.base/pie-execl.exp
@@ -16,6 +16,9 @@
# The problem was due to amd64_skip_prologue attempting to access inferior
# memory before the PIE (Position Independent Executable) gets relocated.
+global inferior_spawn_id
+global gdb_spawn_id
+
if ![istarget *-linux*] {
continue
}
@@ -67,6 +70,7 @@ gdb_test_multiple "p/x &pie_execl_marker" $test {
verbose -log "addr1 is $addr1"
set test "continue"
+set matches_found 0
gdb_test_multiple $test $test {
-re "Error in re-setting breakpoint" {
fail $test
@@ -74,8 +78,24 @@ gdb_test_multiple $test $test {
-re "Cannot access memory" {
fail $test
}
- -re "pie-execl: re-exec.*executing new program.*\r\nBreakpoint \[0-9\]+,\[^\r\n\]* pie_execl_marker .*\r\n$gdb_prompt $" {
- pass $test
+ -i "$inferior_spawn_id" -re "pie-execl: re-exec" {
+ # output from inferior
+ incr matches_found
+ if { $matches_found == 2 } {
+ pass $test
+ } else {
+ exp_continue
+ }
+ }
+ -i "$gdb_spawn_id"
+ -re "executing new program.*\r\nBreakpoint \[0-9\]+,\[^\r\n\]* pie_execl_marker .*\r\n$gdb_prompt $" {
+ # output from gdb
+ incr matches_found
+ if { $matches_found == 2 } {
+ pass $test
+ } else {
+ exp_continue
+ }
}
}