Debugging helper functions.
Function | ascii |
Draw a graph, starting at a given position. |
Function | prettyprint |
Pretty print a binding with variable id and data. |
Function | prettyprint |
Pretty print a binding and its recursive contents. |
Function | prettyprint |
Pretty print a set of bindings, with optional label. |
Function | prettyprint |
A reasonably compact representation of all the bindings at a node. |
Function | prettyprint |
Pretty print a cfg tree with the bindings at each node. |
Function | program |
Generate a text (CFG nodes + assignments) version of a program. |
Function | root |
Tries to determine why a binding isn't possible at a node. |
Function | set |
Undocumented |
Function | show |
Pretty print values for debugging. |
Function | show |
Print out the block structure of an OrderedCode object as a table. |
Function | stack |
Undocumented |
Function | trace |
Record args and return value for a function call. |
Function | tracer |
Undocumented |
Function | tracing |
Undocumented |
Function | _ascii |
Draw a graph, starting at a given position. |
Function | _pretty |
Return a pretty printed string for a Variable. |
Function | _setup |
Customise tabulate. |
Draw a graph, starting at a given position. Args: node: The node from where to draw. get_children: The function to call to retrieve children. get_description: Optional. A function to call to describe a node. Returns: A string.
A reasonably compact representation of all the bindings at a node. Args: node: The node to prettyprint. decorate_after_node: Don't print bindings unless node_id > this. full: Print the full string representation of a binding's data Returns: A prettyprinted node.
Pretty print a cfg tree with the bindings at each node. Args: root: The root node. decorate_after_node: Don't print bindings unless node_id > this. full: Print the full string representation of a binding's data forward: Traverse the tree forwards if true. Returns: A prettyprinted tree.
Generate a text (CFG nodes + assignments) version of a program. For debugging only. Args: program: An instance of cfg.Program Returns: A string representing all of the data for this program.
Tries to determine why a binding isn't possible at a node. This tries to find the innermost source that's still impossible. It only works if the failure isn't due to a combination of bindings. Args: binding: A binding, or a list of bindings. node: The node at which (one of the) binding(s) is impossible. seen: Internal. Bindings already looked at. Returns: A tuple (binding, node), with "binding" the innermost binding that's not possible, and "node" the CFG node at which it isn't.
Print out the block structure of an OrderedCode object as a table. Args: code: A blocks.OrderedCode object extra_col: A map from opcode_index to a single additional cell to display
Record args and return value for a function call. The trace is of the form function name: { function name: arg = value function name: arg = value ... function name: -> return function name: } This will let us write tools to pretty print the traces with indentation etc. Args: name: module name, usually `__name__` *trace_args: function arguments to log Returns: a decorator
Draw a graph, starting at a given position. Args: out: A file-like object to write the ascii tree to. node: The node from where to draw. p1: The current prefix. p2: The upcoming prefix. seen: Nodes we have seen so far (as a set). get_children: The function to call to retrieve children. get_description: Optional. A function to call to describe a node.