This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: PING [RFC] Testsuite: permit simple transformation of gdb_expect code
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: gdb-patches at sourceware dot org, drow at false dot org
- Date: Wed, 16 Jun 2010 16:13:57 +0200
- Subject: Re: PING [RFC] Testsuite: permit simple transformation of gdb_expect code
- References: <000901cb0c52$b7d767b0$27863710$@muller@ics-cnrs.unistra.fr>
On Tue, 15 Jun 2010 08:19:30 +0200, Pierre Muller wrote:
> use only a procedure, but this would mean
> that there is no way to insert its code inside
> gdb.exp itself.
I do not understand this part.
> This allows to use either
> unset transform_gdb_expect_code
> or
> set transform_gdb_expect_code ""
> to disable the transformation at any point
> in the testsuite.
With the patch proposed below one defines it using:
proc transform_gdb_expect_code { expcode } {
verbose -log "code = <$expcode>"
return $expcode
}
and undefines it using:
rename transform_gdb_expect_code ""
Thanks,
Jan
2010-06-16 Pierre Muller <muller@ics.u-strasbg.fr>
Jan Kratochvil <jan.kratochvil@redhat.com>
* lib/gdb.exp (gdb_expect): Call transform_gdb_expect_code procedure
if it exists.
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2178,6 +2178,13 @@ proc gdb_expect { args } {
}
}
+ # The global procedure transform_gdb_expect_code can transform the code
+ # parameter of gdb_expect call in order to cope for some target dependant
+ # problems.
+ if { "[info procs transform_gdb_expect_code]" != "" } {
+ set expcode [transform_gdb_expect_code $expcode]
+ }
+
global suppress_flag;
global remote_suppress_flag;
if [info exists remote_suppress_flag] {