Thursday, July 7, 2011

minor debugging option changes

Sorry I don't have a lot of engineering time, but I changed the debug options for printing phases a little, and the code handling it is a little cleaner than before. Sorry for breaking it in the meantime.

First, the relevant options are, as per the help screen "skdev --help:debug",

    --debug-print-passes   Print names of stages and visitors as they execute
 -p,--debug-dump-after     Stages / visitors to dump the program after (comma-sep)
 -P,--debug-dump-before    Stages / visitors to dump the program before (comma-sep)



The first option prints the passes as they are executed, for example,

    [1310074020.4000 - DEBUG] Running stage 'parse' -- Parse the program from a file
    [1310074020.4600 - DEBUG] Running stage BeforeSemanticCheckStage
    [1310074020.4620 - DEBUG]    Running visitor MinimizeFcnCall
...
    [1310074020.4810 - DEBUG] Running stage 'preproc' -- Preprocessing (used for all further transformations)
...
    [1310074020.5150 - DEBUG] Running stage 'hlc' -- High level C
...

Then, you can debug one of those with the "--debug-dump-after" or "--debug-dump-before" flags, e.g. skdev --debug-dump-after parse,sten src/test/sk/seq/miniTest1.sk, which will print the program after the parse and sten stages. In the future, I hope to add a "--debug-dump-diff" flag, which will let one see the changes a stage has made in bash colored output.

No comments:

Post a Comment