GDB (xrefs)
Classes | Public Member Functions | Private Attributes | List of all members
gdb.xmethod.SimpleXMethodMatcher Class Reference
Inheritance diagram for gdb.xmethod.SimpleXMethodMatcher:
gdb.xmethod.XMethodMatcher gdb.xmethod.XMethodMatcher

Classes

class  SimpleXMethodWorker
 

Public Member Functions

def __init__ (self, name, class_matcher, method_matcher, method_function, arg_types)
 
def match (self, class_type, method_name)
 
def __init__ (self, name, class_matcher, method_matcher, method_function, arg_types)
 
def match (self, class_type, method_name)
 
- Public Member Functions inherited from gdb.xmethod.XMethodMatcher
def __init__ (self, name)
 
def match (self, class_type, method_name)
 
def __init__ (self, name)
 
def match (self, class_type, method_name)
 

Private Attributes

 _method_function
 
 _class_matcher
 
 _method_matcher
 
 _arg_types
 

Additional Inherited Members

- Public Attributes inherited from gdb.xmethod.XMethodMatcher
 name
 
 enabled
 
 methods
 

Detailed Description

A utility class to implement simple xmethod mathers and workers.

See the __init__ method below for information on how instances of this
class can be used.

For simple classes and methods, one can choose to use this class.  For
complex xmethods, which need to replace/implement template methods on
possibly template classes, one should implement their own xmethod
matchers and workers.  See py-xmethods.py in testsuite/gdb.python
directory of the GDB source tree for examples.

Definition at line 151 of file xmethod.py.

Constructor & Destructor Documentation

def gdb.xmethod.SimpleXMethodMatcher.__init__ (   self,
  name,
  class_matcher,
  method_matcher,
  method_function,
  arg_types 
)
Args:
    name: Name of the xmethod matcher.
    class_matcher: A regular expression used to match the name of the
class whose method this xmethod is implementing/replacing.
    method_matcher: A regular expression used to match the name of the
method this xmethod is implementing/replacing.
    method_function: A Python callable which would be called via the
'invoke' method of the worker returned by the objects of this
class.  This callable should accept the object (*this) as the
first argument followed by the rest of the arguments to the
method. All arguments to this function should be gdb.Value
objects.
    arg_types: The gdb.Type objects corresponding to the arguments that
this xmethod takes. It can be None, or an empty sequence,
or a single gdb.Type object, or a sequence of gdb.Type objects.

Definition at line 177 of file xmethod.py.

def gdb.xmethod.SimpleXMethodMatcher.__init__ (   self,
  name,
  class_matcher,
  method_matcher,
  method_function,
  arg_types 
)
Args:
    name: Name of the xmethod matcher.
    class_matcher: A regular expression used to match the name of the
class whose method this xmethod is implementing/replacing.
    method_matcher: A regular expression used to match the name of the
method this xmethod is implementing/replacing.
    method_function: A Python callable which would be called via the
'invoke' method of the worker returned by the objects of this
class.  This callable should accept the object (*this) as the
first argument followed by the rest of the arguments to the
method. All arguments to this function should be gdb.Value
objects.
    arg_types: The gdb.Type objects corresponding to the arguments that
this xmethod takes. It can be None, or an empty sequence,
or a single gdb.Type object, or a sequence of gdb.Type objects.

Definition at line 177 of file xmethod.py.

References gdb.xmethod.SimpleXMethodMatcher.SimpleXMethodWorker._arg_types, gdb.xmethod.SimpleXMethodMatcher._arg_types, gdb.xmethod.SimpleXMethodMatcher._class_matcher, gdb.xmethod.SimpleXMethodMatcher.SimpleXMethodWorker._method_function, gdb.xmethod.SimpleXMethodMatcher._method_function, and gdb.xmethod.SimpleXMethodMatcher._method_matcher.

Member Function Documentation

def gdb.xmethod.SimpleXMethodMatcher.match (   self,
  class_type,
  method_name 
)
def gdb.xmethod.SimpleXMethodMatcher.match (   self,
  class_type,
  method_name 
)

Member Data Documentation

gdb.xmethod.SimpleXMethodMatcher._arg_types
private
gdb.xmethod.SimpleXMethodMatcher._class_matcher
private
gdb.xmethod.SimpleXMethodMatcher._method_function
private
gdb.xmethod.SimpleXMethodMatcher._method_matcher
private

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