-# Copyright 2010, 2011 Free Software Foundation, Inc.
+# Copyright 2010-2012 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
pass $test
}
}
- -re "Stopped due to shared library event\r\n$gdb_prompt $" {
+ -re "Stopped due to (spurious )?shared library event.*\r\n$gdb_prompt $" {
if {$func == "_dl_debug_state"} {
if {$debug_state_count == 0} {
# First stop does not yet relocate the _start function
# displacement of 0 bytes to be present, "NONZERO" for displacement of non-0
# bytes to be present and "PRESENT" if both "ZERO" and "NONZERO" are valid.
proc reach {func command displacement} {
- global pf_prefix
- set old_ldprefix $pf_prefix
- lappend pf_prefix "reach-$func:"
-
- reach_1 $func $command $displacement
-
- set pf_prefix $old_ldprefix
+ with_test_prefix "reach-$func" {
+ reach_1 $func $command $displacement
+ }
}
-proc test_core {file displacement} {
+proc test_core {file displacement} { with_test_prefix "core" {
global srcdir subdir gdb_prompt expect_out
set corefile [core_find $file {} "segv"]
return
}
- global pf_prefix
- set old_ldprefix $pf_prefix
- lappend pf_prefix "core:"
-
gdb_exit
gdb_start
# Clear it to never find any separate debug infos in $debug_root.
}
gdb_test "bt" "#\[0-9\]+ +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#\[0-9\]+ +\[^\r\n\]*\\mmain\\M.*" "core main bt"
+}}
- set pf_prefix $old_ldprefix
-}
-
-proc test_attach_gdb {file pid displacement prefix} {
+proc test_attach_gdb {file pid displacement prefix} { with_test_prefix "$prefix" {
global gdb_prompt expect_out
- global pf_prefix
- set old_ldprefix $pf_prefix
- lappend pf_prefix "$prefix:"
-
gdb_exit
gdb_start
# Print the "PIE (Position Independent Executable) displacement" message.
gdb_test_no_output "set verbose on"
- if {$file != ""} {
- gdb_test "file $file" "Reading symbols from .*done\\." "file"
- }
+ gdb_test "file $file" "Reading symbols from .*done\\." "file"
set test "attach"
gdb_test_multiple "attach $pid" $test {
gdb_test "bt" "#\[0-9\]+ +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#\[0-9\]+ +\[^\r\n\]*\\mmain\\M.*" "attach main bt"
gdb_exit
-
- set pf_prefix $old_ldprefix
-}
+}}
proc test_attach {file displacement {relink_args ""}} {
global board_info
+ global exec
gdb_exit
}
if {$relink_args == ""} {
- test_attach_gdb "" $pid $displacement "attach"
+ test_attach_gdb $exec $pid $displacement "attach"
} else {
# These could be rather passed as arguments.
- global exec interp_saved interp
+ global interp_saved interp
foreach relink {YES NO} {
# Formerly this test was testing only prelinking of $EXEC. As the
global pf_prefix
set old_ldprefix $pf_prefix
- lappend pf_prefix "symbol-less:"
+ append pf_prefix " symbol-less:"
# Test also `exec-file'-command loaded $FILE - therefore without symbols.
# SYMBOL_OBJFILE is not available and only EXEC_BFD must be used.
set interp_saved ${interp}-saved
set pf_prefix $old_ldprefix
- lappend pf_prefix "$ldname:"
+ append pf_prefix " $ldname:"
if {$ldsepdebug == "NO"} {
file_copy $interp_system $interp
set exec $binprefix-$binname
set pf_prefix $old_binprefix
- lappend pf_prefix "$binname:"
+ append pf_prefix " $binname:"
set opts "ldflags=-Wl,$binfile_lib,-rpath,[file dirname $binfile_lib]"
if {$binsepdebug != "NO"} {