GDB (xrefs)
Public Member Functions | List of all members
gdb.xmethod.XMethodWorker Class Reference
Inheritance diagram for gdb.xmethod.XMethodWorker:
gdb.xmethod.SimpleXMethodMatcher.SimpleXMethodWorker gdb.xmethod.SimpleXMethodMatcher.SimpleXMethodWorker

Public Member Functions

def get_arg_types (self)
 
def get_result_type (self, args)
 
def __call__ (self, args)
 
def get_arg_types (self)
 
def get_result_type (self, args)
 
def __call__ (self, args)
 

Detailed Description

Base class for all xmethod workers defined in Python.

An xmethod worker is an object which matches the method arguments, and
invokes the method when GDB wants it to.  Internally, GDB first invokes the
'get_arg_types' method to perform overload resolution.  If GDB selects to
invoke this Python xmethod, then it invokes it via the overridden
'__call__' method.  The 'get_result_type' method is used to implement
'ptype' on the xmethod.

Derived classes should override the 'get_arg_types', 'get_result_type'
and '__call__' methods.

Definition at line 97 of file xmethod.py.

Member Function Documentation

def gdb.xmethod.XMethodWorker.__call__ (   self,
  args 
)
Invoke the xmethod.

Args:
    args: Arguments to the method.  Each element of the tuple is a
gdb.Value object.  The first element is the 'this' pointer
value.

Returns:
    A gdb.Value corresponding to the value returned by the xmethod.
    Returns 'None' if the method does not return anything.

Definition at line 136 of file xmethod.py.

Referenced by gdb.xmethod.XMethodWorker.__call__().

def gdb.xmethod.XMethodWorker.__call__ (   self,
  args 
)
Invoke the xmethod.

Args:
    args: Arguments to the method.  Each element of the tuple is a
gdb.Value object.  The first element is the 'this' pointer
value.

Returns:
    A gdb.Value corresponding to the value returned by the xmethod.
    Returns 'None' if the method does not return anything.

Definition at line 136 of file xmethod.py.

References gdb.xmethod.XMethodWorker.__call__().

def gdb.xmethod.XMethodWorker.get_arg_types (   self)
Return arguments types of an xmethod.

A sequence of gdb.Type objects corresponding to the arguments of the
xmethod are returned.  If the xmethod takes no arguments, then 'None'
or an empty sequence is returned.  If the xmethod takes only a single
argument, then a gdb.Type object or a sequence with a single gdb.Type
element is returned.

Definition at line 111 of file xmethod.py.

References gdb.xmethod.XMethodWorker.get_arg_types().

def gdb.xmethod.XMethodWorker.get_arg_types (   self)
Return arguments types of an xmethod.

A sequence of gdb.Type objects corresponding to the arguments of the
xmethod are returned.  If the xmethod takes no arguments, then 'None'
or an empty sequence is returned.  If the xmethod takes only a single
argument, then a gdb.Type object or a sequence with a single gdb.Type
element is returned.

Definition at line 111 of file xmethod.py.

Referenced by gdb.xmethod.XMethodWorker.get_arg_types().

def gdb.xmethod.XMethodWorker.get_result_type (   self,
  args 
)
Return the type of the result of the xmethod.

Args:
    args: Arguments to the method.  Each element of the tuple is a
gdb.Value object.  The first element is the 'this' pointer
value.  These are the same arguments passed to '__call__'.

Returns:
    A gdb.Type object representing the type of the result of the
    xmethod.

Definition at line 122 of file xmethod.py.

Referenced by gdb.xmethod.XMethodWorker.get_result_type().

def gdb.xmethod.XMethodWorker.get_result_type (   self,
  args 
)
Return the type of the result of the xmethod.

Args:
    args: Arguments to the method.  Each element of the tuple is a
gdb.Value object.  The first element is the 'this' pointer
value.  These are the same arguments passed to '__call__'.

Returns:
    A gdb.Type object representing the type of the result of the
    xmethod.

Definition at line 122 of file xmethod.py.

References gdb.xmethod.XMethodWorker.get_result_type().


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