aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2013-09-20 21:47:06 +0000
committerDoug Evans <dje@google.com>2013-09-20 21:47:06 +0000
commit4fa7d390970c4e558fc42b8d5ff4d42b60240db4 (patch)
tree70483ea08ea0dc76a38b9045c7f4703489ce2085 /gdb/testsuite/lib
parentecb33a79498ac5cdf7f284b64585e343bd1bbba3 (diff)
downloadgdb-4fa7d390970c4e558fc42b8d5ff4d42b60240db4.zip
gdb-4fa7d390970c4e558fc42b8d5ff4d42b60240db4.tar.gz
gdb-4fa7d390970c4e558fc42b8d5ff4d42b60240db4.tar.bz2
* lib/future.exp (gdb_find_objcopy, gdb_find_readelf): New procs.
* lib/gdb.exp (build_id_debug_filename_get): Update to use them. (gdb_gnu_strip_debug): Ditto. * lib/prelink-support.exp (section_get, prelink_no): Ditto. * gdb.arch/altivec-abi.exp: Ditto. * gdb.base/attach-pie-misread.exp: Ditto. * gdb.base/comprdebug.exp: Ditto. * gdb.base/dup-sect.exp: Ditto. * gdb.base/gnu-debugdata.exp: Ditto. * gdb.base/step-symless.exp: Ditto. * gdb.dwarf2/dw2-inline-param.exp: Ditto. * gdb.dwarf2/dw2-skip-prologue.exp: Ditto. * gdb.dwarf2/gdb-index.exp: Ditto.
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r--gdb/testsuite/lib/future.exp20
-rw-r--r--gdb/testsuite/lib/gdb.exp4
-rw-r--r--gdb/testsuite/lib/prelink-support.exp4
3 files changed, 24 insertions, 4 deletions
diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp
index 422342b..553f562 100644
--- a/gdb/testsuite/lib/future.exp
+++ b/gdb/testsuite/lib/future.exp
@@ -94,6 +94,26 @@ proc gdb_find_ldd {} {
return $ldd
}
+proc gdb_find_objcopy {} {
+ global OBJCOPY_FOR_TARGET
+ if [info exists OBJCOPY_FOR_TARGET] {
+ set objcopy $OBJCOPY_FOR_TARGET
+ } else {
+ set objcopy [transform objcopy]
+ }
+ return $objcopy
+}
+
+proc gdb_find_readelf {} {
+ global READELF_FOR_TARGET
+ if [info exists READELF_FOR_TARGET] {
+ set readelf $READELF_FOR_TARGET
+ } else {
+ set readelf [transform readelf]
+ }
+ return $readelf
+}
+
proc gdb_default_target_compile {source destfile type options} {
global target_triplet
global tool_root_dir
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 05e66ef..5e3331a 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3944,7 +3944,7 @@ gdb_caching_proc gdb_skip_xml_test {
# Return "" if no build-id found.
proc build_id_debug_filename_get { exec } {
set tmp [standard_output_file "${exec}-tmp"]
- set objcopy_program [transform objcopy]
+ set objcopy_program [gdb_find_objcopy]
set result [catch "exec $objcopy_program -j .note.gnu.build-id -O binary $exec $tmp" output]
verbose "result is $result"
@@ -3982,7 +3982,7 @@ proc gdb_gnu_strip_debug { dest args } {
set debug_file "${dest}.debug"
set strip_to_file_program [transform strip]
- set objcopy_program [transform objcopy]
+ set objcopy_program [gdb_find_objcopy]
set debug_link [file tail $debug_file]
set stripped_file "${dest}.stripped"
diff --git a/gdb/testsuite/lib/prelink-support.exp b/gdb/testsuite/lib/prelink-support.exp
index bd10017..887a58e 100644
--- a/gdb/testsuite/lib/prelink-support.exp
+++ b/gdb/testsuite/lib/prelink-support.exp
@@ -20,7 +20,7 @@
proc section_get {exec section} {
global subdir
set tmp [standard_output_file section_get.tmp]
- set objcopy_program [transform objcopy]
+ set objcopy_program [gdb_find_objcopy]
set command "exec $objcopy_program -O binary --set-section-flags $section=A --change-section-address $section=0 -j $section $exec $tmp"
verbose -log "command is $command"
@@ -211,7 +211,7 @@ proc prelink_no {arg {name {}}} {
# Skip prelink options.
continue
}
- set readelf_program [transform readelf]
+ set readelf_program [gdb_find_readelf]
set command "exec $readelf_program -WS $bin"
verbose -log "command is $command"
set result [catch $command output]