Download PGI Tools Guide
Transcript
The optional arguments may appear in any order after the required argument and should not be
delimited by commas.
For example:
watch i at 37 if(y>1)
This event definition says that whenever execution is at line 37, and the value of i has changed
since the last time execution was at line 37, and y is greater than 1, stop and print the new value of
i.
do {print xyz} in f
This event definition says that at each line in the routine f print the value of xyz.
break func1 if (i==37) do {print a[37]; stack}
This event definition says that each time the routine func1 is entered and i is equal to 37, then
the value of a[37] should be printed, and a stack trace should be performed.
Event commands that do not explicitly define a location will occur at each source line in the
program. For example:
do {where}
prints the current location at the start of each source line, and
track a.b
prints the value of a.b at the start of each source line if the value has changed.
Events that occur at every line can be useful, but to perform them requires single-stepping the
target program (this may slow execution considerably). Restricting an event to a particular address
causes minimal impact on program execution speed, while restricting an event to a single routine
causes execution to be slowed only when that routine is executed.
PGDBG supports instruction level versions of several commands (for example breaki, watchi,
tracki, and doi). The basic difference in the instruction version is that these commands will
interpret integers as addresses rather than line numbers, and events will occur at each instruction
rather than at each line.
When multiple events occur at the same location, all event actions will be taken before the prompt
for input. Defining event actions that resume execution is allowed but discouraged, since
continuing execution may prevent or defer other event actions. For example:
break 37 do {continue}
The PGDBG Debugger
41