Debugging OTcl code in Mash

Here are two tools that can help you debug your Mash program if you work primarily in OTcl space (instead of C++ space).

otcl_traceExec

If you set the global variable otcl_traceExec to 1, all calls to OTcl procedures will be printed, along with their arguments and return values.
    set ::otcl_traceExec 1
    # do something
    set ::otcl_traceExec 0

MashInspector

MashInspector allow you to peek into the object space in Mash, listing all available classes, objects, procedures and members. You can browse through the object space easily, and interact with Mash through a text entry.

To use MashInspector, you just need to import the class and create a new instance.

    import MashInspector
    new MashInspector