llvm-project/lldb/source/Plugins/ScriptInterpreter/Python
Jorge Gorbe Moya d76566417e [lldb] Add matching based on Python callbacks for data formatters.
This patch adds a new matching method for data formatters, in addition
to the existing exact typename and regex-based matching. The new method
allows users to specify the name of a Python callback function that
takes a `SBType` object and decides whether the type is a match or not.

Here is an overview of the changes performed:

- Add a new `eFormatterMatchCallback` matching type, and logic to handle
  it in `TypeMatcher` and `SBTypeNameSpecifier`.

- Extend `FormattersMatchCandidate` instances with a pointer to the
  current `ScriptInterpreter` and the `TypeImpl` corresponding to the
  candidate type, so we can run registered callbacks and pass the type
  to them. All matcher search functions now receive a
  `FormattersMatchCandidate` instead of a type name.

- Add some glue code to ScriptInterpreterPython and the SWIG bindings to
  allow calling a formatter matching callback. Most of this code is
  modeled after the equivalent code for watchpoint callback functions.

- Add an API test for the new callback-based matching feature.

For more context, please check the RFC thread where this feature was
originally discussed:
https://discourse.llvm.org/t/rfc-python-callback-for-data-formatters-type-matching/64204/11

Differential Revision: https://reviews.llvm.org/D135648
2022-10-19 12:53:38 -07:00
..
CMakeLists.txt [llvm][lldb] use FindLibEdit.cmake everywhere 2022-05-12 15:59:41 -07:00
PythonDataObjects.cpp [lldb] Use nullptr instead of NULL (NFC) 2022-08-27 21:21:07 -07:00
PythonDataObjects.h [lldb] Fix modernize-use-override warnings (NFC) 2022-06-17 15:08:02 -07:00
PythonReadline.cpp [lldb] Use nullptr instead of NULL (NFC) 2022-08-27 21:21:07 -07:00
PythonReadline.h
SWIGPythonBridge.cpp [lldb/Interpreter] Add ScriptInterpreter Wrapper for ScriptedProcess 2021-03-23 18:24:47 +01:00
SWIGPythonBridge.h [lldb] Add matching based on Python callbacks for data formatters. 2022-10-19 12:53:38 -07:00
ScriptInterpreterPython.cpp [lldb] Add matching based on Python callbacks for data formatters. 2022-10-19 12:53:38 -07:00
ScriptInterpreterPython.h [lldb] Clarify StructuredDataImpl ownership 2021-12-13 21:04:51 +01:00
ScriptInterpreterPythonImpl.h [lldb] Add matching based on Python callbacks for data formatters. 2022-10-19 12:53:38 -07:00
ScriptedProcessPythonInterface.cpp [lldb/Plugins] Add ability to load modules to Scripted Processes 2022-03-04 13:35:28 -08:00
ScriptedProcessPythonInterface.h [lldb/Plugins] Add ability to load modules to Scripted Processes 2022-03-04 13:35:28 -08:00
ScriptedPythonInterface.cpp [lldb/Plugin] Add artificial stackframe loading in ScriptedThread 2022-02-16 11:44:07 -08:00
ScriptedPythonInterface.h [lldb] Fix modernize-use-override warnings (NFC) 2022-06-17 15:08:02 -07:00
ScriptedThreadPythonInterface.cpp [lldb/Plugin] Add artificial stackframe loading in ScriptedThread 2022-02-16 11:44:07 -08:00
ScriptedThreadPythonInterface.h [lldb/Plugins] Add support of multiple ScriptedThreads in a ScriptedProcess 2022-01-24 20:25:53 +01:00
lldb-python.h Work around a module build failure on the bots. 2022-01-20 13:39:48 -08:00