2004-12-22 (
FP)
A way to debug C functions of a
Critcl script foo.tcl:
1- Insert these lines in the script foo.tcl
package require critcl 0.34 ;# NEEDS > 0.33 #
critcl::config force 1 ;# optional, force recompilation
critcl::config keepsrc 1 ;# keep sources in cache
critcl::config lines 0 ;# code references cached C sources, not tcl source
critcl::cheaders -g ;# keep symbols inside library
critcl::cproc bar {...
2- Launch the debugger gdb (or ddd) executing the
Tclkit program
shell$ ddd tclkit
3- Run the program in order to construct and compile C functions
gdb> run path_to_critcl/critcl foo.tcl
4- Insert breakpoint. Note that "critcl::cproc bar ..." has generated C functions "tcl_bar" and "c_bar"
gdb> break tcl_bar
5- Rerun the program
gdb> run
jcw - As mentioned above, this needs 0.34 which adds the "lines" config option. Good stuff, btw.