86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
-
+
-
+
|
}
#
# NOTE: This procedure attempts to load the TclDevKit remote debugger
# package into the specified Tcl interpreter. By default, the
# "master" Tcl interpreter will be used. If the native Tcl
# "primary" Tcl interpreter will be used. If the native Tcl
# interface is not ready or if the remote debugger package
# cannot be loaded, an error will be raised.
#
proc tcl_debugger_setup { {interp ""} } {
if {![tcl ready]} then {error "native Tcl interface is not ready"}
if {[string length $interp] == 0} then {set interp [tcl master]}
if {[string length $interp] == 0} then {set interp [tcl primary]}
set directory [getTclDevKitDirectory]
if {[string length $directory] == 0} then {
error "the TclDevKit does not appear to be installed"
|
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
|
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
|
-
+
-
+
-
+
-
+
-
+
|
}
#
# NOTE: This procedure attempts to initialize the TclDevKit remote
# debugger in the specified Tcl interpreter. By default, the
# "master" Tcl interpreter will be used. If the native Tcl
# "primary" Tcl interpreter will be used. If the native Tcl
# interface is not ready or if the remote debugger package
# cannot be initialized, an error will be raised.
#
proc tcl_debugger_init {
{interp ""} {host 127.0.0.1} {port 2576} {cdata {}} } {
if {![tcl ready]} then {error "native Tcl interface is not ready"}
if {[string length $interp] == 0} then {set interp [tcl master]}
if {[string length $interp] == 0} then {set interp [tcl primary]}
tcl_eval $interp [list debugger_init $host $port $cdata]
}
#
# NOTE: This procedure attempts to evaluate a Tcl script under control
# of the TclDevKit remote debugger. By default, the "master" Tcl
# of the TclDevKit remote debugger. By default, the "primary" Tcl
# interpreter will be used. If the native Tcl interface is not
# ready or if the remote debugger package fails to evaluate the
# Tcl script, an error will be raised.
#
proc tcl_debugger_eval { {interp ""} args } {
if {![tcl ready]} then {error "native Tcl interface is not ready"}
if {[string length $interp] == 0} then {set interp [tcl master]}
if {[string length $interp] == 0} then {set interp [tcl primary]}
tcl_eval $interp debugger_eval $args
}
#
# NOTE: This procedure attempts to tell the TclDevKit remote debugger
# to break the execution of the Tcl script in progress.
#
proc tcl_debugger_break { {interp ""} {str ""} } {
if {![tcl ready]} then {error "native Tcl interface is not ready"}
if {[string length $interp] == 0} then {set interp [tcl master]}
if {[string length $interp] == 0} then {set interp [tcl primary]}
tcl_eval $interp [list debugger_break $str]
}
}
|