In many cases, your knowledge of what a program is doing lets you make predictions as to where problems are occurring. The following CLI macro parses comments that you can include in a source file and, depending on the comment’s text, sets a
breakpoint or an eval point.
The only similarity between this macro and the previous three is that almost all of the statements are Tcl. The only purely CLI commands are the instances of the
dbreak command that set eval points and breakpoints.
The make_actions macro reads a source file one line at a time. As it reads these lines, the regular expressions look for comments that begin with
/* STOP,
/* EVAL, and
/* CMD. After parsing the comment, it sets a breakpoint at a
stop line, an eval point at an
eval line, or executes a command at a
cmd line.
Using eval points can be confusing because eval point syntax differs from that of Tcl. In this example, the
$stop function is built into the CLI. Stated differently, you can end up with Tcl code that also contains C, C++, Fortran, and TotalView functions, variables, and statements. Fortunately, you only use this kind of mixture in a few places and you’ll know what you’re doing.