Debugger¶
QuickStart¶
Pfp comes with a built-in debugger. You can drop into the interactive
debugger by calling the Int3()
function
within a template.
All commands are documented below in the debug reference documentation.
Command methods begin with do_
.
Internals¶
While the pfp interpreter is handling AST nodes, it decides if a node
can be “breaked” on using the _node_is_breakable
method. If the
interpreter is in a debug state, and the current node can be breaked
on, the user will be dropped into the interactive debugger.
Debugger Reference Documentation¶
-
class
pfp.dbg.
PfpDbg
(interp)[source]¶ The pfp debugger cmd.Cmd class
-
default
(line)[source]¶ Called on an input line when the command prefix is not recognized.
If this method is not overridden, it prints an error message and returns.
-
do_eval
(args)[source]¶ Eval the user-supplied statement. Note that you can do anything with this command that you can do in a template.
The resulting value of your statement will be displayed.
-
do_peek
(args)[source]¶ Peek at the next 16 bytes in the stream:
Example:
The peek command will display the next 16 hex bytes in the input stream:
pfp> peek 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 .PNG........IHDR
-
do_show
(args)[source]¶ Show the current structure of __root (no args), or show the result of the expression (something that can be eval’d).
-