GDB (xrefs)

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

## 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

## ◆ __init__() [1/2]

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.

## ◆ __init__() [2/2]

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

## ◆ match() [1/2]

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

Definition at line 204 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.

Referenced by gdb.xmethod.SimpleXMethodMatcher.match().

## ◆ match() [2/2]

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

Definition at line 204 of file xmethod.py.

References gdb.xmethod.SimpleXMethodMatcher.SimpleXMethodWorker._arg_types, gdb.xmethod.SimpleXMethodMatcher._arg_types, gdb.xmethod.SimpleXMethodMatcher._class_matcher, gdb.xmethod._lookup_xmethod_matcher(), gdb.xmethod.SimpleXMethodMatcher.SimpleXMethodWorker._method_function, gdb.xmethod.SimpleXMethodMatcher._method_function, gdb.xmethod.SimpleXMethodMatcher._method_matcher, gdb.xmethod._validate_xmethod_matcher(), gdb.xmethod.SimpleXMethodMatcher.match(), and gdb.xmethod.register_xmethod_matcher().

## Member Data Documentation

## ◆ _arg_types

gdb.xmethod.SimpleXMethodMatcher._arg_types
| private

Definition at line 202 of file xmethod.py.

Referenced by gdb.xmethod.SimpleXMethodMatcher.__init__(), and gdb.xmethod.SimpleXMethodMatcher.match().

## ◆ _class_matcher

gdb.xmethod.SimpleXMethodMatcher._class_matcher
| private

Definition at line 200 of file xmethod.py.

Referenced by gdb.xmethod.SimpleXMethodMatcher.__init__(), and gdb.xmethod.SimpleXMethodMatcher.match().

## ◆ _method_function

gdb.xmethod.SimpleXMethodMatcher._method_function
| private

Definition at line 199 of file xmethod.py.

Referenced by gdb.xmethod.SimpleXMethodMatcher.__init__(), and gdb.xmethod.SimpleXMethodMatcher.match().

## ◆ _method_matcher

gdb.xmethod.SimpleXMethodMatcher._method_matcher
| private

Definition at line 201 of file xmethod.py.

Referenced by gdb.xmethod.SimpleXMethodMatcher.__init__(), and gdb.xmethod.SimpleXMethodMatcher.match().

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

- /tmp/gdb-8.1/gdb/data-directory/python/gdb/xmethod.py