diff options
author | Tom Tromey <tromey@redhat.com> | 2009-07-10 18:48:41 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2009-07-10 18:48:41 +0000 |
commit | 812f73424775824b59fe27c6e87f183c72571c80 (patch) | |
tree | cd8ff25033084da40beabea2151b2513264ec7a5 /gdb/testsuite | |
parent | f07749bbae83adb37c54f7c6079c1999af292724 (diff) | |
download | gdb-812f73424775824b59fe27c6e87f183c72571c80.zip gdb-812f73424775824b59fe27c6e87f183c72571c80.tar.gz gdb-812f73424775824b59fe27c6e87f183c72571c80.tar.bz2 |
gdb/doc
* gdbint.texinfo (Testsuite): Document test transcripts.
gdb/testsuite
* lib/gdb.exp: Handle TRANSCRIPT.
(remote_spawn, remote_close, send_gdb): New procs.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 46 |
2 files changed, 51 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index d1ac5a4..ff692ca 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-07-09 Tom Tromey <tromey@redhat.com> + + * lib/gdb.exp: Handle TRANSCRIPT. + (remote_spawn, remote_close, send_gdb): New procs. + 2009-07-10 Phil Muldoon <pmuldoon@redhat.com> * gdb.python/python-prettyprint.c: Add counted null string diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 200ab35..96f7d02 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2983,3 +2983,49 @@ proc get_sizeof { type default } { return [get_integer_valueof "sizeof (${type})" $default] } +# Log gdb command line and script if requested. +if {[info exists TRANSCRIPT]} { + rename send_gdb real_send_gdb + rename remote_spawn real_remote_spawn + rename remote_close real_remote_close + + global gdb_transcript + set gdb_transcript "" + + global gdb_trans_count + set gdb_trans_count 1 + + proc remote_spawn {args} { + global gdb_transcript gdb_trans_count outdir + + if {$gdb_transcript != ""} { + close $gdb_transcript + } + set gdb_transcript [open [file join $outdir transcript.$gdb_trans_count] w] + puts $gdb_transcript [lindex $args 1] + incr gdb_trans_count + + return [uplevel real_remote_spawn $args] + } + + proc remote_close {args} { + global gdb_transcript + + if {$gdb_transcript != ""} { + close $gdb_transcript + set gdb_transcript "" + } + + return [uplevel real_remote_close $args] + } + + proc send_gdb {args} { + global gdb_transcript + + if {$gdb_transcript != ""} { + puts -nonewline $gdb_transcript [lindex $args 0] + } + + return [uplevel real_send_gdb $args] + } +} |