summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp
diff options
context:
space:
mode:
authorMed Ismail Bennani <medismail.bennani@gmail.com>2022-02-28 17:37:28 -0800
committerMed Ismail Bennani <medismail.bennani@gmail.com>2022-03-04 13:35:19 -0800
commit6eddd987c9c9d2ab76ed53eea452b34145992ed9 (patch)
tree34058f5689d710927e463d3e0967eb51affc01b2 /lldb/source/Plugins/Process/scripted/ScriptedThread.cpp
parent2a29c3f72e8d93385be83bd24a993c3bb57ac181 (diff)
[lldb/Plugin] Use static ScriptedInterface::ErrorWithMessage function (NFC)
This patch replaces the calls to ErrorWithMessage using the GetInterface message by a call to the static method directly. Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Diffstat (limited to 'lldb/source/Plugins/Process/scripted/ScriptedThread.cpp')
-rw-r--r--lldb/source/Plugins/Process/scripted/ScriptedThread.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp b/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp
index 8174a8bde331..e28f66015dd5 100644
--- a/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp
+++ b/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp
@@ -121,7 +121,7 @@ ScriptedThread::CreateRegisterContextForFrame(StackFrame *frame) {
llvm::Optional<std::string> reg_data = GetInterface()->GetRegisterContext();
if (!reg_data)
- return GetInterface()->ErrorWithMessage<lldb::RegisterContextSP>(
+ return ScriptedInterface::ErrorWithMessage<lldb::RegisterContextSP>(
LLVM_PRETTY_FUNCTION, "Failed to get scripted thread registers data.",
error, LLDBLog::Thread);
@@ -129,7 +129,7 @@ ScriptedThread::CreateRegisterContextForFrame(StackFrame *frame) {
std::make_shared<DataBufferHeap>(reg_data->c_str(), reg_data->size()));
if (!data_sp->GetByteSize())
- return GetInterface()->ErrorWithMessage<lldb::RegisterContextSP>(
+ return ScriptedInterface::ErrorWithMessage<lldb::RegisterContextSP>(
LLVM_PRETTY_FUNCTION, "Failed to copy raw registers data.", error,
LLDBLog::Thread);
@@ -137,7 +137,7 @@ ScriptedThread::CreateRegisterContextForFrame(StackFrame *frame) {
std::make_shared<RegisterContextMemory>(
*this, 0, *GetDynamicRegisterInfo(), LLDB_INVALID_ADDRESS);
if (!reg_ctx_memory)
- return GetInterface()->ErrorWithMessage<lldb::RegisterContextSP>(
+ return ScriptedInterface::ErrorWithMessage<lldb::RegisterContextSP>(
LLVM_PRETTY_FUNCTION, "Failed to create a register context.", error,
LLDBLog::Thread);
@@ -152,13 +152,13 @@ bool ScriptedThread::LoadArtificialStackFrames() {
Status error;
if (!arr_sp)
- return GetInterface()->ErrorWithMessage<bool>(
+ return ScriptedInterface::ErrorWithMessage<bool>(
LLVM_PRETTY_FUNCTION, "Failed to get scripted thread stackframes.",
error, LLDBLog::Thread);
size_t arr_size = arr_sp->GetSize();
if (arr_size > std::numeric_limits<uint32_t>::max())
- return GetInterface()->ErrorWithMessage<bool>(
+ return ScriptedInterface::ErrorWithMessage<bool>(
LLVM_PRETTY_FUNCTION,
llvm::Twine(
"StackFrame array size (" + llvm::Twine(arr_size) +
@@ -174,7 +174,7 @@ bool ScriptedThread::LoadArtificialStackFrames() {
StructuredData::Dictionary *dict;
if (!arr_sp->GetItemAtIndexAsDictionary(idx, dict) || !dict)
- return GetInterface()->ErrorWithMessage<bool>(
+ return ScriptedInterface::ErrorWithMessage<bool>(
LLVM_PRETTY_FUNCTION,
llvm::Twine(
"Couldn't get artificial stackframe dictionary at index (" +
@@ -203,7 +203,7 @@ bool ScriptedThread::LoadArtificialStackFrames() {
StackFrame::Kind::Artificial, behaves_like_zeroth_frame, &sc);
if (!frames->SetFrameAtIndex(static_cast<uint32_t>(idx), synth_frame_sp))
- return GetInterface()->ErrorWithMessage<bool>(
+ return ScriptedInterface::ErrorWithMessage<bool>(
LLVM_PRETTY_FUNCTION,
llvm::Twine("Couldn't add frame (" + llvm::Twine(idx) +
llvm::Twine(") to ScriptedThread StackFrameList."))
@@ -219,7 +219,7 @@ bool ScriptedThread::CalculateStopInfo() {
Status error;
if (!dict_sp)
- return GetInterface()->ErrorWithMessage<bool>(
+ return ScriptedInterface::ErrorWithMessage<bool>(
LLVM_PRETTY_FUNCTION, "Failed to get scripted thread stop info.", error,
LLDBLog::Thread);
@@ -227,14 +227,14 @@ bool ScriptedThread::CalculateStopInfo() {
lldb::StopReason stop_reason_type;
if (!dict_sp->GetValueForKeyAsInteger("type", stop_reason_type))
- return GetInterface()->ErrorWithMessage<bool>(
+ return ScriptedInterface::ErrorWithMessage<bool>(
LLVM_PRETTY_FUNCTION,
"Couldn't find value for key 'type' in stop reason dictionary.", error,
LLDBLog::Thread);
StructuredData::Dictionary *data_dict;
if (!dict_sp->GetValueForKeyAsDictionary("data", data_dict))
- return GetInterface()->ErrorWithMessage<bool>(
+ return ScriptedInterface::ErrorWithMessage<bool>(
LLVM_PRETTY_FUNCTION,
"Couldn't find value for key 'data' in stop reason dictionary.", error,
LLDBLog::Thread);
@@ -266,7 +266,7 @@ bool ScriptedThread::CalculateStopInfo() {
StopInfo::CreateStopReasonWithException(*this, description.data());
} break;
default:
- return GetInterface()->ErrorWithMessage<bool>(
+ return ScriptedInterface::ErrorWithMessage<bool>(
LLVM_PRETTY_FUNCTION,
llvm::Twine("Unsupported stop reason type (" +
llvm::Twine(stop_reason_type) + llvm::Twine(")."))