This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC/Patch v7] Debug methods using GDB Python


Attached is the latest version of the patch which adds the debug
methods feature to the GDB Python API. Changes from previous versions:

1. From the user point of view, the debug method API exposes a concept
of a DebugMethodMatcher, and a DebugMethodWorker.  A
DebugMethodMatcher matches class type and method name, and a
DebugMethodWorker is the worker which actually invokes the debug
method. A DebugMethodWorker also does arg type matching indirectly.
Internally, GDB first calls the DebugMethodMatcher which returns all
matching workers. Next, GDB picks a winner among these workers based
on the arg types the workers return/serve. Finally, the winning worker
is invoked. A matcher can manage a number of named workers which a
user can enable/disable using the appropriate command.

2. Formatting cleanup. There could be other tabs vs space formatting
issues still left, especially on the GDB side of the *.c changes. I am
working on cleaning up the code changes in this part. I will fix the
formatting issues along with it.

3. No docs yet as the actual Python API is not yet finalized.

2014-01-22  Siva Chandra Reddy  <>

        * Add entries for new files.
        * data-directory/ Add entries for new Python files.
        * eval.c (evaluate_subexp_standard): Lookup and invoke methods
        defined in extension languages.
        * valarith.c (value_x_binop, value_x_unop): Lookup and invoke
        overloaded operator methods defined in extension languages.
        * valops.c (find_oload_method_list, find_method_list,
        find_overload_match, find_oload_champ): Lookup methods defined
        in extension languages.
        (value_has_indirect_dynamic_type): New function to determine
        the indirect dynamic type of a value.
        * value.h (find_overload_match): Update signature.
        * ext-function.c: New file.
        * ext-function.h: New file.
        * python/py-debugmethods.c: New file.
        * python/py-objfile.c (objfile_object): New field
        (objfpy_dealloc): XDECREF on the new debugmethod_matcherss field.
        (objfpy_new, objfile_to_objfile_object): Initialize
        debugmethod_macthers field.
        (objfpy_get_debugmethod_matchers): New function.
        (objfile_getset): New entry 'debugmethod_matchers'.
        * python/py-progspace.c (pspace_object): New field
        (pspy_dealloc): XDECREF on the new debugmethod_matchers field.
        (pspy_new, pspace_to_pspace_object): Initialize
        debugmethod_matchers field.
        (pspy_get_debugmethod_matchers): New function.
        (pspace_getset): New entry 'debug_methods'.
        * python/python-internal.h: Add declarations for new functions.
        * python/python.c (_initialize_python): Invoke
        * python/python.h: Add declarations of new functions.
        * python/lib/gdb/ (debug_methods): New attribute.
        * python/lib/gdb/ New file.
        * python/lib/gdb/command/ New file.

        * gdb.python/ New testcase to test debug
        * gdb.python/py-debugmethods.exp: New tests to test debug
        * gdb.python/ Python script supporting the
        new testcase and tests.

Attachment: dm_patch_v7.txt
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]