This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit/testsuite] Do not build the DejaGNU status wrapper repeatedly
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sourceware dot org
- Date: Fri, 13 Nov 2009 17:53:21 -0500
- Subject: [commit/testsuite] Do not build the DejaGNU status wrapper repeatedly
While working on other testing issues, I noticed that every GDB test
recompiled the DejaGNU status wrapper (on targets which need it,
including arm-none-eabi and various others). All the copies are the
same; we really only need one per multilib. This patch implements
that idea in the straightforward way.
Tested on arm-none-eabi and x86_64-linux. Checked in.
2009-11-13 Daniel Jacobowitz <dan@codesourcery.com>
* lib/gdb.exp (current_target_name): New procedure.
(gdb_wrapper_target): New variable.
(gdb_wrapper_init): Set gdb_wrapper_target.
(default_gdb_init): Check gdb_wrapper_target before rebuilding the
wrapper.
---
gdb/testsuite/lib/gdb.exp | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
Index: gdb/testsuite/lib/gdb.exp
===================================================================
--- gdb/testsuite/lib/gdb.exp.orig 2009-11-12 12:40:59.000000000 -0800
+++ gdb/testsuite/lib/gdb.exp 2009-11-13 09:33:15.000000000 -0800
@@ -1699,12 +1699,24 @@ proc test_compiler_info { {compiler ""}
return [string match $compiler $compiler_info]
}
+proc current_target_name { } {
+ global target_info
+ if [info exists target_info(target,name)] {
+ set answer $target_info(target,name)
+ } else {
+ set answer ""
+ }
+ return $answer
+}
+
set gdb_wrapper_initialized 0
+set gdb_wrapper_target ""
proc gdb_wrapper_init { args } {
global gdb_wrapper_initialized;
global gdb_wrapper_file;
global gdb_wrapper_flags;
+ global gdb_wrapper_target
if { $gdb_wrapper_initialized == 1 } { return; }
@@ -1719,6 +1731,7 @@ proc gdb_wrapper_init { args } {
}
}
set gdb_wrapper_initialized 1
+ set gdb_wrapper_target [current_target_name]
}
# Some targets need to always link a special object in. Save its path here.
@@ -2361,6 +2374,7 @@ proc gdb_continue { function } {
proc default_gdb_init { args } {
global gdb_wrapper_initialized
+ global gdb_wrapper_target
global cleanfiles
set cleanfiles {}
@@ -2369,7 +2383,9 @@ proc default_gdb_init { args } {
# Make sure that the wrapper is rebuilt
# with the appropriate multilib option.
- set gdb_wrapper_initialized 0
+ if { $gdb_wrapper_target != [current_target_name] } {
+ set gdb_wrapper_initialized 0
+ }
# Unlike most tests, we have a small number of tests that generate
# a very large amount of output. We therefore increase the expect
--
Daniel Jacobowitz
CodeSourcery