This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PING [RFC] Testsuite: permit simple transformation of gdb_expect code


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] {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]