2012-02-24 Pedro Alves <palves@redhat.com>
* gdb.base/break-interp.exp (test_ld): Use with_test_prefix. (top level): Use with_test_prefix.
This commit is contained in:
parent
13fc3e3cf9
commit
11337c2fed
2 changed files with 204 additions and 207 deletions
|
@ -1,3 +1,8 @@
|
|||
2012-02-24 Pedro Alves <palves@redhat.com>
|
||||
|
||||
* gdb.base/break-interp.exp (test_ld): Use with_test_prefix.
|
||||
(top level): Use with_test_prefix.
|
||||
|
||||
2012-02-24 Pedro Alves <palves@redhat.com>
|
||||
|
||||
* gdb.threads/attach-into-signal.exp (corefunc): Use
|
||||
|
|
|
@ -411,12 +411,10 @@ proc test_ld {file ifmain trynosym displacement} {
|
|||
return
|
||||
}
|
||||
|
||||
global pf_prefix
|
||||
set old_ldprefix $pf_prefix
|
||||
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.
|
||||
with_test_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.
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
|
@ -424,7 +422,8 @@ proc test_ld {file ifmain trynosym displacement} {
|
|||
gdb_test_no_output "set debug-file-directory"
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
|
||||
# Print the "PIE (Position Independent Executable) displacement" message.
|
||||
# Print the "PIE (Position Independent Executable)
|
||||
# displacement" message.
|
||||
gdb_test_no_output "set verbose on"
|
||||
|
||||
# Test no (error) message has been printed by `exec-file'.
|
||||
|
@ -465,8 +464,8 @@ proc test_ld {file ifmain trynosym displacement} {
|
|||
gdb_test "continue" "\r\nBreakpoint \[0-9\]+, 0x0*$entrynohex in .*" "entry point reached"
|
||||
}
|
||||
} else {
|
||||
# There is no symbol to break at ld.so. Moreover it can exit with an
|
||||
# error code.
|
||||
# There is no symbol to break at ld.so. Moreover it can
|
||||
# exit with an error code.
|
||||
|
||||
set test "ld.so exit"
|
||||
set test_displacement "seen displacement message as $displacement"
|
||||
|
@ -495,14 +494,12 @@ proc test_ld {file ifmain trynosym displacement} {
|
|||
fail $test_displacement
|
||||
}
|
||||
}
|
||||
|
||||
set pf_prefix $old_ldprefix
|
||||
}
|
||||
}
|
||||
|
||||
# Create separate binaries for each testcase - to make the possible reported
|
||||
# problem reproducible after the whole test run finishes.
|
||||
|
||||
set old_ldprefix $pf_prefix
|
||||
foreach ldprelink {NO YES} {
|
||||
foreach ldsepdebug {NO IN SEP} {
|
||||
# Skip running the ldsepdebug test if we do not have system separate
|
||||
|
@ -527,9 +524,7 @@ foreach ldprelink {NO YES} {
|
|||
# possibly unprelinked ld.so to test all the combinations for GDB.
|
||||
set interp_saved ${interp}-saved
|
||||
|
||||
set pf_prefix $old_ldprefix
|
||||
append pf_prefix " $ldname:"
|
||||
|
||||
with_test_prefix "$ldname" {
|
||||
if {$ldsepdebug == "NO"} {
|
||||
file_copy $interp_system $interp
|
||||
# Never call strip-debug before unprelink:
|
||||
|
@ -583,9 +578,10 @@ foreach ldprelink {NO YES} {
|
|||
if {$ldprelink == "NO"} {
|
||||
set displacement "NONZERO"
|
||||
} else {
|
||||
# x86* kernel loads prelinked PIE binary at its prelinked address
|
||||
# but ppc* kernel loads it at a random address. prelink normally
|
||||
# skips PIE binaries during the system scan.
|
||||
# x86* kernel loads prelinked PIE binary at its
|
||||
# prelinked address but ppc* kernel loads it at a
|
||||
# random address. prelink normally skips PIE binaries
|
||||
# during the system scan.
|
||||
set displacement "PRESENT"
|
||||
}
|
||||
test_ld $interp 0 [expr {$ldsepdebug == "NO"}] $displacement
|
||||
|
@ -593,12 +589,12 @@ foreach ldprelink {NO YES} {
|
|||
if ![file_copy $interp $interp_saved] {
|
||||
continue
|
||||
}
|
||||
set old_binprefix $pf_prefix
|
||||
|
||||
foreach binprelink {NO YES} {
|
||||
foreach binsepdebug {NO IN SEP} {
|
||||
# "ATTACH" is like "YES" but it is modified during run.
|
||||
# It cannot be used for problem reproducibility after the
|
||||
# testcase ends.
|
||||
# "ATTACH" is like "YES" but it is modified during
|
||||
# run. It cannot be used for problem
|
||||
# reproducibility after the testcase ends.
|
||||
foreach binpie {NO YES ATTACH} {
|
||||
# This combination is not possible, non-PIE (fixed address)
|
||||
# binary cannot be prelinked to any (other) address.
|
||||
|
@ -609,9 +605,7 @@ foreach ldprelink {NO YES} {
|
|||
set binname "BINprelink${binprelink}debug${binsepdebug}pie${binpie}"
|
||||
set exec $binprefix-$binname
|
||||
|
||||
set pf_prefix $old_binprefix
|
||||
append pf_prefix " $binname:"
|
||||
|
||||
with_test_prefix "$binname" {
|
||||
set opts "ldflags=-Wl,$binfile_lib,-rpath,[file dirname $binfile_lib]"
|
||||
if {$binsepdebug != "NO"} {
|
||||
lappend opts {debug}
|
||||
|
@ -635,10 +629,9 @@ foreach ldprelink {NO YES} {
|
|||
} elseif {$binprelink == "NO"} {
|
||||
set displacement "NONZERO"
|
||||
} else {
|
||||
# x86* kernel loads prelinked PIE binary at its
|
||||
# prelinked address but ppc* kernel loads it at
|
||||
# a random address. prelink normally skips PIE
|
||||
# binaries during the system scan.
|
||||
# x86* kernel loads prelinked PIE binary at its prelinked
|
||||
# address but ppc* kernel loads it at a random address.
|
||||
# prelink normally skips PIE binaries during the system scan.
|
||||
set displacement "PRESENT"
|
||||
}
|
||||
|
||||
|
@ -647,21 +640,19 @@ foreach ldprelink {NO YES} {
|
|||
if {$binpie != "ATTACH"} {
|
||||
test_ld $exec 1 [expr {$binsepdebug == "NO"}] $displacement
|
||||
} else {
|
||||
# If the file has been randomly prelinked it must
|
||||
# be "NONZERO". We could see "ZERO" only if it was
|
||||
# unprelinked and it is now running at the same
|
||||
# address - which is 0 but executable can never run
|
||||
# at address 0.
|
||||
# If the file has been randomly prelinked it must be
|
||||
# "NONZERO". We could see "ZERO" only if it was unprelinked
|
||||
# and it is now running at the same address - which is 0 but
|
||||
# executable can never run at address 0.
|
||||
|
||||
set displacement "NONZERO"
|
||||
test_attach $exec $displacement $relink_args
|
||||
|
||||
# ATTACH means that executables and libraries have
|
||||
# been modified after they have been run. They
|
||||
# cannot be reused for problem reproducibility after
|
||||
# the testcase ends in the ATTACH case. Therefore
|
||||
# they are rather deleted not to confuse after the
|
||||
# run finishes.
|
||||
# ATTACH means that executables and libraries have been
|
||||
# modified after they have been run. They cannot be reused
|
||||
# for problem reproducibility after the testcase ends in
|
||||
# the ATTACH case. Therefore they are rather deleted not
|
||||
# to confuse after the run finishes.
|
||||
set exec_debug [system_debug_get $exec]
|
||||
if {$exec_debug != ""} {
|
||||
# `file delete [glob "${exec_debug}*"]' does not work.
|
||||
|
@ -679,8 +670,9 @@ foreach ldprelink {NO YES} {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
file delete $interp_saved
|
||||
}
|
||||
}
|
||||
}
|
||||
set pf_prefix $old_ldprefix
|
||||
|
|
Loading…
Reference in a new issue