[lldb] Introduce StackFrameRecognizer [take 2]

This patch introduces a concept of "frame recognizer" and "recognized frame". This should be an extensible mechanism that retrieves information about special frames based on ABI, arguments or other special properties of that frame, even without source code. A few examples where that could be useful could be 1) objc_exception_throw, where we'd like to get the current exception, 2) terminate_with_reason and extracting the current terminate string, 3) recognizing Objective-C frames and automatically extracting the receiver+selector, or perhaps all arguments (based on selector).

Differential Revision: https://reviews.llvm.org/D44603

llvm-svn: 345686
This commit is contained in:
Kuba Mracek
2018-10-31 00:36:20 +00:00
parent 3e27306565
commit 8fddd98185
24 changed files with 1162 additions and 16 deletions

View File

@@ -94,6 +94,12 @@ public:
const char *session_dictionary_name,
const lldb::ProcessSP &process_sp);
typedef void *(*SWIGPythonCreateFrameRecognizer)(
const char *python_class_name, const char *session_dictionary_name);
typedef void *(*SWIGPythonGetRecognizedArguments)(
void *implementor, const lldb::StackFrameSP &frame_sp);
typedef size_t (*SWIGPythonCalculateNumChildren)(void *implementor,
uint32_t max);
@@ -231,6 +237,13 @@ public:
ScriptedBreakpointResolverSearchDepth(StructuredData::GenericSP
implementor_sp) override;
StructuredData::GenericSP
CreateFrameRecognizer(const char *class_name) override;
lldb::ValueObjectListSP
GetRecognizedArguments(const StructuredData::ObjectSP &implementor,
lldb::StackFrameSP frame_sp) override;
StructuredData::GenericSP
OSPlugin_CreatePluginObject(const char *class_name,
lldb::ProcessSP process_sp) override;
@@ -426,6 +439,8 @@ public:
SWIGPythonCallCommandObject swig_call_command_object,
SWIGPythonCallModuleInit swig_call_module_init,
SWIGPythonCreateOSPlugin swig_create_os_plugin,
SWIGPythonCreateFrameRecognizer swig_create_frame_recognizer,
SWIGPythonGetRecognizedArguments swig_get_recognized_arguments,
SWIGPythonScriptKeyword_Process swig_run_script_keyword_process,
SWIGPythonScriptKeyword_Thread swig_run_script_keyword_thread,
SWIGPythonScriptKeyword_Target swig_run_script_keyword_target,