From f6838f814769c627c1d61f6905f69f704b334af6 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Fri, 13 Nov 2009 22:51:59 +0000 Subject: [PATCH] * 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/ChangeLog | 8 ++++++++ gdb/testsuite/lib/gdb.exp | 18 +++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 4af502fa108..fefd6289b56 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2009-11-13 Daniel Jacobowitz + + * 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. + 2009-11-13 Daniel Jacobowitz * gdb.base/remote.exp: Delete the slowest load test. diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index b5e55ec12c3..7d06d0791e0 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -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 -- 2.30.2