PSI update
r1464 | ffr | 2007-02-12 12:20:21 +1100 (Mon, 12 Feb 2007) | 2 lines
This commit is contained in:
committed by
Douglas Clowes
parent
634f2023b1
commit
3168325921
40
test/sicstcldebug.tcl
Normal file
40
test/sicstcldebug.tcl
Normal file
@@ -0,0 +1,40 @@
|
||||
#------------------------------------------------------------------
|
||||
# This is a helper file in order to debug SICS Tcl scripts. The idea
|
||||
# is that a connection to a SICS interpreter at localhost:2911 is opened.
|
||||
# Then unknown is reimplemented to send unknown commands (which must be
|
||||
# SICS commands) to the SICS interpreter for evaluation. This is done
|
||||
# with transact in order to figure out when SICS finished processing.
|
||||
# Thus is should be possible to debug SICS Tcl scripts in a normal
|
||||
# standalone interpreter without the overhead of restarting SICS
|
||||
# all the time. It may even be possible to use one of the normal
|
||||
# Tcl debuggers then....
|
||||
#
|
||||
# Mark Koennecke, February 2006
|
||||
#------------------------------------------------------------------
|
||||
|
||||
set socke [socket localhost 2911]
|
||||
gets $socke
|
||||
puts $socke "Spy Spy"
|
||||
flush $socke
|
||||
gets $socke
|
||||
#------------------------------------------------------------------
|
||||
proc unknown args {
|
||||
global socke
|
||||
append com "transact " [join $args]
|
||||
puts $socke $com
|
||||
flush $socke
|
||||
set reply ""
|
||||
while {1} {
|
||||
set line [gets $socke]
|
||||
if {[string first TRANSACTIONFINISHED $line] >= 0} {
|
||||
return $reply
|
||||
} else {
|
||||
append reply $line "\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
#------------------------------------------------------------------
|
||||
proc clientput args {
|
||||
puts stdout [join $args]
|
||||
}
|
||||
#------------------------------------------------------------------
|
||||
Reference in New Issue
Block a user