Skip to content

Commit

Permalink
[lldb] Fix build failure introduced in 4840384 (NFC)
Browse files Browse the repository at this point in the history
Signed-off-by: Med Ismail Bennani <[email protected]>
  • Loading branch information
medismailben committed Oct 31, 2023
1 parent e137af6 commit ed5faa4
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ StructuredData::DictionarySP ScriptedProcessPythonInterface::GetCapabilities() {
StructuredData::DictionarySP dict =
Dispatch<StructuredData::DictionarySP>("get_capabilities", error);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict,
error))
return {};

return dict;
Expand Down Expand Up @@ -90,7 +91,8 @@ StructuredData::DictionarySP ScriptedProcessPythonInterface::GetThreadsInfo() {
StructuredData::DictionarySP dict =
Dispatch<StructuredData::DictionarySP>("get_threads_info", error);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict,
error))
return {};

return dict;
Expand All @@ -106,7 +108,8 @@ bool ScriptedProcessPythonInterface::CreateBreakpoint(lldb::addr_t addr,
if (py_error.Fail())
error = py_error;

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
return {};

return obj->GetBooleanValue();
Expand All @@ -131,7 +134,8 @@ lldb::offset_t ScriptedProcessPythonInterface::WriteMemoryAtAddress(
StructuredData::ObjectSP obj =
Dispatch("write_memory_at_address", py_error, addr, data_sp, error);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
return LLDB_INVALID_OFFSET;

// If there was an error on the python call, surface it to the user.
Expand All @@ -146,7 +150,8 @@ StructuredData::ArraySP ScriptedProcessPythonInterface::GetLoadedImages() {
StructuredData::ArraySP array =
Dispatch<StructuredData::ArraySP>("get_loaded_images", error);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, array, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, array,
error))
return {};

return array;
Expand All @@ -156,7 +161,8 @@ lldb::pid_t ScriptedProcessPythonInterface::GetProcessID() {
Status error;
StructuredData::ObjectSP obj = Dispatch("get_process_id", error);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
return LLDB_INVALID_PROCESS_ID;

return obj->GetUnsignedIntegerValue(LLDB_INVALID_PROCESS_ID);
Expand All @@ -166,7 +172,8 @@ bool ScriptedProcessPythonInterface::IsAlive() {
Status error;
StructuredData::ObjectSP obj = Dispatch("is_alive", error);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
return {};

return obj->GetBooleanValue();
Expand All @@ -177,7 +184,8 @@ ScriptedProcessPythonInterface::GetScriptedThreadPluginName() {
Status error;
StructuredData::ObjectSP obj = Dispatch("get_scripted_thread_plugin", error);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
return {};

return obj->GetStringValue().str();
Expand All @@ -193,7 +201,8 @@ StructuredData::DictionarySP ScriptedProcessPythonInterface::GetMetadata() {
StructuredData::DictionarySP dict =
Dispatch<StructuredData::DictionarySP>("get_process_metadata", error);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict,
error))
return {};

return dict;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ ScriptedThreadPlanPythonInterface::ExplainsStop(Event *event) {
Status error;
StructuredData::ObjectSP obj = Dispatch("explains_stop", error, event);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
return error.ToError();

return obj->GetBooleanValue();
Expand All @@ -51,7 +52,8 @@ ScriptedThreadPlanPythonInterface::ShouldStop(Event *event) {
Status error;
StructuredData::ObjectSP obj = Dispatch("should_stop", error, event);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
return error.ToError();

return obj->GetBooleanValue();
Expand All @@ -61,7 +63,8 @@ llvm::Expected<bool> ScriptedThreadPlanPythonInterface::IsStale() {
Status error;
StructuredData::ObjectSP obj = Dispatch("is_stale", error);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
return error.ToError();

return obj->GetBooleanValue();
Expand All @@ -71,7 +74,8 @@ lldb::StateType ScriptedThreadPlanPythonInterface::GetRunState() {
Status error;
StructuredData::ObjectSP obj = Dispatch("should_step", error);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
return lldb::eStateStepping;

return static_cast<lldb::StateType>(obj->GetUnsignedIntegerValue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ lldb::tid_t ScriptedThreadPythonInterface::GetThreadID() {
Status error;
StructuredData::ObjectSP obj = Dispatch("get_thread_id", error);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
return LLDB_INVALID_THREAD_ID;

return obj->GetUnsignedIntegerValue(LLDB_INVALID_THREAD_ID);
Expand All @@ -55,7 +56,8 @@ std::optional<std::string> ScriptedThreadPythonInterface::GetName() {
Status error;
StructuredData::ObjectSP obj = Dispatch("get_name", error);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
return {};

return obj->GetStringValue().str();
Expand All @@ -65,7 +67,8 @@ lldb::StateType ScriptedThreadPythonInterface::GetState() {
Status error;
StructuredData::ObjectSP obj = Dispatch("get_state", error);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
return eStateInvalid;

return static_cast<StateType>(obj->GetUnsignedIntegerValue(eStateInvalid));
Expand All @@ -75,7 +78,8 @@ std::optional<std::string> ScriptedThreadPythonInterface::GetQueue() {
Status error;
StructuredData::ObjectSP obj = Dispatch("get_queue", error);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
return {};

return obj->GetStringValue().str();
Expand All @@ -86,7 +90,8 @@ StructuredData::DictionarySP ScriptedThreadPythonInterface::GetStopReason() {
StructuredData::DictionarySP dict =
Dispatch<StructuredData::DictionarySP>("get_stop_reason", error);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict,
error))
return {};

return dict;
Expand All @@ -97,7 +102,8 @@ StructuredData::ArraySP ScriptedThreadPythonInterface::GetStackFrames() {
StructuredData::ArraySP arr =
Dispatch<StructuredData::ArraySP>("get_stackframes", error);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, arr, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, arr,
error))
return {};

return arr;
Expand All @@ -108,7 +114,8 @@ StructuredData::DictionarySP ScriptedThreadPythonInterface::GetRegisterInfo() {
StructuredData::DictionarySP dict =
Dispatch<StructuredData::DictionarySP>("get_register_info", error);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict,
error))
return {};

return dict;
Expand All @@ -118,7 +125,8 @@ std::optional<std::string> ScriptedThreadPythonInterface::GetRegisterContext() {
Status error;
StructuredData::ObjectSP obj = Dispatch("get_register_context", error);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
error))
return {};

return obj->GetAsString()->GetValue().str();
Expand All @@ -129,7 +137,8 @@ StructuredData::ArraySP ScriptedThreadPythonInterface::GetExtendedInfo() {
StructuredData::ArraySP arr =
Dispatch<StructuredData::ArraySP>("get_extended_info", error);

if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, arr, error))
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, arr,
error))
return {};

return arr;
Expand Down

0 comments on commit ed5faa4

Please sign in to comment.