30.01.2013 Views

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Automatically Setting Breakpoints<br />

}<br />

/* TEST: Check to see if we can access all the<br />

values */<br />

i=i; /* STOP: */<br />

i=1; /* EVAL: if (sbfo.f3 != 3) $stop; */<br />

i=2; /* EVAL: if (sbfo.f4 != 4) $stop; */<br />

i=3; /* EVAL: if (sbfo.f5 != 5) $stop; */<br />

...<br />

return 0;<br />

The make_actions macro reads a source file one line at a time. As it reads<br />

these lines, the regular expressions look for comments that begin with<br />

/* STOP, /* EVAL, and /* CMD. After parsing the comment, it sets a breakpoint<br />

at a stop line or an eval point at an eval line, or executes a command at<br />

a cmd line.<br />

Using eval points can be confusing because eval point syntax differs from<br />

that of Tcl. In this example, the $stop function is built into the CLI. Stated<br />

differently, you can end up with Tcl code that also contains C, C++, Fortran,<br />

and <strong>TotalView</strong> functions, variables, and statements. Fortunately, you<br />

only use this kind of mixture in a few places and you’ll know what you’re<br />

doing.<br />

220 Chapter 11: Seeing the CLI at Work

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!