Revert "[lldb] Fix build failure introduced in 484038416d06 (NFC)"

This reverts commit ed5faa475b since it
introduces test failures:

https://lab.llvm.org/buildbot/#/builders/68/builds/62556
This commit is contained in:
Med Ismail Bennani 2023-10-30 17:38:36 -07:00
parent ed5faa475b
commit 2b7ba0155d
3 changed files with 22 additions and 44 deletions

View File

@ -49,8 +49,7 @@ StructuredData::DictionarySP ScriptedProcessPythonInterface::GetCapabilities() {
StructuredData::DictionarySP dict =
Dispatch<StructuredData::DictionarySP>("get_capabilities", error);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict, error))
return {};
return dict;
@ -91,8 +90,7 @@ StructuredData::DictionarySP ScriptedProcessPythonInterface::GetThreadsInfo() {
StructuredData::DictionarySP dict =
Dispatch<StructuredData::DictionarySP>("get_threads_info", error);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict, error))
return {};
return dict;
@ -108,8 +106,7 @@ bool ScriptedProcessPythonInterface::CreateBreakpoint(lldb::addr_t addr,
if (py_error.Fail())
error = py_error;
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
return {};
return obj->GetBooleanValue();
@ -134,8 +131,7 @@ lldb::offset_t ScriptedProcessPythonInterface::WriteMemoryAtAddress(
StructuredData::ObjectSP obj =
Dispatch("write_memory_at_address", py_error, addr, data_sp, error);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
return LLDB_INVALID_OFFSET;
// If there was an error on the python call, surface it to the user.
@ -150,8 +146,7 @@ StructuredData::ArraySP ScriptedProcessPythonInterface::GetLoadedImages() {
StructuredData::ArraySP array =
Dispatch<StructuredData::ArraySP>("get_loaded_images", error);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, array,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, array, error))
return {};
return array;
@ -161,8 +156,7 @@ lldb::pid_t ScriptedProcessPythonInterface::GetProcessID() {
Status error;
StructuredData::ObjectSP obj = Dispatch("get_process_id", error);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
return LLDB_INVALID_PROCESS_ID;
return obj->GetUnsignedIntegerValue(LLDB_INVALID_PROCESS_ID);
@ -172,8 +166,7 @@ bool ScriptedProcessPythonInterface::IsAlive() {
Status error;
StructuredData::ObjectSP obj = Dispatch("is_alive", error);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
return {};
return obj->GetBooleanValue();
@ -184,8 +177,7 @@ ScriptedProcessPythonInterface::GetScriptedThreadPluginName() {
Status error;
StructuredData::ObjectSP obj = Dispatch("get_scripted_thread_plugin", error);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
return {};
return obj->GetStringValue().str();
@ -201,8 +193,7 @@ StructuredData::DictionarySP ScriptedProcessPythonInterface::GetMetadata() {
StructuredData::DictionarySP dict =
Dispatch<StructuredData::DictionarySP>("get_process_metadata", error);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict, error))
return {};
return dict;

View File

@ -40,8 +40,7 @@ ScriptedThreadPlanPythonInterface::ExplainsStop(Event *event) {
Status error;
StructuredData::ObjectSP obj = Dispatch("explains_stop", error, event);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
return error.ToError();
return obj->GetBooleanValue();
@ -52,8 +51,7 @@ ScriptedThreadPlanPythonInterface::ShouldStop(Event *event) {
Status error;
StructuredData::ObjectSP obj = Dispatch("should_stop", error, event);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
return error.ToError();
return obj->GetBooleanValue();
@ -63,8 +61,7 @@ llvm::Expected<bool> ScriptedThreadPlanPythonInterface::IsStale() {
Status error;
StructuredData::ObjectSP obj = Dispatch("is_stale", error);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
return error.ToError();
return obj->GetBooleanValue();
@ -74,8 +71,7 @@ lldb::StateType ScriptedThreadPlanPythonInterface::GetRunState() {
Status error;
StructuredData::ObjectSP obj = Dispatch("should_step", error);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
return lldb::eStateStepping;
return static_cast<lldb::StateType>(obj->GetUnsignedIntegerValue(

View File

@ -45,8 +45,7 @@ lldb::tid_t ScriptedThreadPythonInterface::GetThreadID() {
Status error;
StructuredData::ObjectSP obj = Dispatch("get_thread_id", error);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
return LLDB_INVALID_THREAD_ID;
return obj->GetUnsignedIntegerValue(LLDB_INVALID_THREAD_ID);
@ -56,8 +55,7 @@ std::optional<std::string> ScriptedThreadPythonInterface::GetName() {
Status error;
StructuredData::ObjectSP obj = Dispatch("get_name", error);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
return {};
return obj->GetStringValue().str();
@ -67,8 +65,7 @@ lldb::StateType ScriptedThreadPythonInterface::GetState() {
Status error;
StructuredData::ObjectSP obj = Dispatch("get_state", error);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
return eStateInvalid;
return static_cast<StateType>(obj->GetUnsignedIntegerValue(eStateInvalid));
@ -78,8 +75,7 @@ std::optional<std::string> ScriptedThreadPythonInterface::GetQueue() {
Status error;
StructuredData::ObjectSP obj = Dispatch("get_queue", error);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
return {};
return obj->GetStringValue().str();
@ -90,8 +86,7 @@ StructuredData::DictionarySP ScriptedThreadPythonInterface::GetStopReason() {
StructuredData::DictionarySP dict =
Dispatch<StructuredData::DictionarySP>("get_stop_reason", error);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict, error))
return {};
return dict;
@ -102,8 +97,7 @@ StructuredData::ArraySP ScriptedThreadPythonInterface::GetStackFrames() {
StructuredData::ArraySP arr =
Dispatch<StructuredData::ArraySP>("get_stackframes", error);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, arr,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, arr, error))
return {};
return arr;
@ -114,8 +108,7 @@ StructuredData::DictionarySP ScriptedThreadPythonInterface::GetRegisterInfo() {
StructuredData::DictionarySP dict =
Dispatch<StructuredData::DictionarySP>("get_register_info", error);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict, error))
return {};
return dict;
@ -125,8 +118,7 @@ std::optional<std::string> ScriptedThreadPythonInterface::GetRegisterContext() {
Status error;
StructuredData::ObjectSP obj = Dispatch("get_register_context", error);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
return {};
return obj->GetAsString()->GetValue().str();
@ -137,8 +129,7 @@ StructuredData::ArraySP ScriptedThreadPythonInterface::GetExtendedInfo() {
StructuredData::ArraySP arr =
Dispatch<StructuredData::ArraySP>("get_extended_info", error);
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, arr,
error))
if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, arr, error))
return {};
return arr;