[lldb/Plugins] Add ScriptedProcess::GetCapabilities affordance (NFC)
This patch introduces a new method to the Scripted Process interface, GetCapabilities. This returns a dictionary that contains a list of flags that the ScriptedProcess instance supports. This can be used for instance, to force symbol lookup, when loading dynamic libraries in the scripted process. Differential Revision: https://reviews.llvm.org/D142059 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
This commit is contained in:
1 parent
e6cac17b56
commit
2d5348be25
4 files changed
+29
-8
No files matched your search
@@ -56,6 +56,17 @@ StructuredData::GenericSP ScriptedProcessPythonInterface::CreatePluginObject(
|
||||
return m_object_instance_sp;
|
||||
}
|
||||
|
||||
StructuredData::DictionarySP ScriptedProcessPythonInterface::GetCapabilities() {
|
||||
Status error;
|
||||
StructuredData::DictionarySP dict =
|
||||
Dispatch<StructuredData::DictionarySP>("get_capabilities", error);
|
||||
|
||||
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict, error))
|
||||
return {};
|
||||
|
||||
return dict;
|
||||
}
|
||||
|
||||
Status ScriptedProcessPythonInterface::Launch() {
|
||||
return GetStatusFromMethod("launch");
|
||||
}
|
||||
@@ -140,14 +151,8 @@ StructuredData::ArraySP ScriptedProcessPythonInterface::GetLoadedImages() {
|
||||
StructuredData::ArraySP array =
|
||||
Dispatch<StructuredData::ArraySP>("get_loaded_images", error);
|
||||
|
||||
if (!array || !array->IsValid() || error.Fail()) {
|
||||
return ScriptedInterface::ErrorWithMessage<StructuredData::ArraySP>(
|
||||
LLVM_PRETTY_FUNCTION,
|
||||
llvm::Twine("Null or invalid object (" +
|
||||
llvm::Twine(error.AsCString()) + llvm::Twine(")."))
|
||||
.str(),
|
||||
error);
|
||||
}
|
||||
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, array, error))
|
||||
return {};
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user