Back to index

python3.2  3.2.2
Public Member Functions
libpython.PyPrint Class Reference

List of all members.

Public Member Functions

def __init__
def invoke

Detailed Description

Definition at line 1625 of file libpython.py.


Constructor & Destructor Documentation

Definition at line 1627 of file libpython.py.

01627 
01628     def __init__(self):
01629         gdb.Command.__init__ (self,
01630                               "py-print",
01631                               gdb.COMMAND_DATA,
01632                               gdb.COMPLETE_NONE)
01633 

Here is the caller graph for this function:


Member Function Documentation

def libpython.PyPrint.invoke (   self,
  args,
  from_tty 
)

Definition at line 1634 of file libpython.py.

01634 
01635     def invoke(self, args, from_tty):
01636         name = str(args)
01637 
01638         frame = Frame.get_selected_python_frame()
01639         if not frame:
01640             print 'Unable to locate python frame'
01641             return
01642 
01643         pyop_frame = frame.get_pyop()
01644         if not pyop_frame:
01645             print 'Unable to read information on python frame'
01646             return
01647 
01648         pyop_var, scope = pyop_frame.get_var_by_name(name)
01649 
01650         if pyop_var:
01651             print ('%s %r = %s'
01652                    % (scope,
01653                       name,
01654                       pyop_var.get_truncated_repr(MAX_OUTPUT_LEN)))
01655         else:
01656             print '%r not found' % name
01657 
01658 PyPrint()


The documentation for this class was generated from the following file: