[Lldb-commits] [PATCH] D137359: [lldb/Plugins] Use default initializers for StructuredData::*SP (NFC)
Med Ismail Bennani via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Nov 3 14:13:29 PDT 2022
mib created this revision.
mib added a reviewer: JDevlieghere.
mib added a project: LLDB.
Herald added a project: All.
mib requested review of this revision.
Herald added a subscriber: lldb-commits.
This patch replaces the ScriptedProcessInterface getters to return
default initializers for StructureData shared pointers instead of
returning a null pointer.
Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D137359
Files:
lldb/include/lldb/Interpreter/ScriptedProcessInterface.h
Index: lldb/include/lldb/Interpreter/ScriptedProcessInterface.h
===================================================================
--- lldb/include/lldb/Interpreter/ScriptedProcessInterface.h
+++ lldb/include/lldb/Interpreter/ScriptedProcessInterface.h
@@ -24,7 +24,7 @@
CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx,
StructuredData::DictionarySP args_sp,
StructuredData::Generic *script_obj = nullptr) override {
- return nullptr;
+ return {};
}
virtual Status Launch() { return Status("ScriptedProcess did not launch"); }
@@ -41,22 +41,22 @@
return {};
}
- virtual StructuredData::DictionarySP GetThreadsInfo() { return nullptr; }
+ virtual StructuredData::DictionarySP GetThreadsInfo() { return {}; }
virtual StructuredData::DictionarySP GetThreadWithID(lldb::tid_t tid) {
- return nullptr;
+ return {};
}
virtual StructuredData::DictionarySP GetRegistersForThread(lldb::tid_t tid) {
- return nullptr;
+ return {};
}
virtual lldb::DataExtractorSP
ReadMemoryAtAddress(lldb::addr_t address, size_t size, Status &error) {
- return nullptr;
+ return {};
}
- virtual StructuredData::ArraySP GetLoadedImages() { return nullptr; }
+ virtual StructuredData::ArraySP GetLoadedImages() { return {}; }
virtual lldb::pid_t GetProcessID() { return LLDB_INVALID_PROCESS_ID; }
@@ -66,12 +66,12 @@
return llvm::None;
}
- virtual StructuredData::DictionarySP GetMetadata() { return nullptr; }
+ virtual StructuredData::DictionarySP GetMetadata() { return {}; }
protected:
friend class ScriptedThread;
virtual lldb::ScriptedThreadInterfaceSP CreateScriptedThreadInterface() {
- return nullptr;
+ return {};
}
};
@@ -81,7 +81,7 @@
CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx,
StructuredData::DictionarySP args_sp,
StructuredData::Generic *script_obj = nullptr) override {
- return nullptr;
+ return {};
}
virtual lldb::tid_t GetThreadID() { return LLDB_INVALID_THREAD_ID; }
@@ -92,17 +92,17 @@
virtual llvm::Optional<std::string> GetQueue() { return llvm::None; }
- virtual StructuredData::DictionarySP GetStopReason() { return nullptr; }
+ virtual StructuredData::DictionarySP GetStopReason() { return {}; }
- virtual StructuredData::ArraySP GetStackFrames() { return nullptr; }
+ virtual StructuredData::ArraySP GetStackFrames() { return {}; }
- virtual StructuredData::DictionarySP GetRegisterInfo() { return nullptr; }
+ virtual StructuredData::DictionarySP GetRegisterInfo() { return {}; }
virtual llvm::Optional<std::string> GetRegisterContext() {
return llvm::None;
}
- virtual StructuredData::ArraySP GetExtendedInfo() { return nullptr; }
+ virtual StructuredData::ArraySP GetExtendedInfo() { return {}; }
};
} // namespace lldb_private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137359.473030.patch
Type: text/x-patch
Size: 2947 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20221103/5fc0a292/attachment.bin>
More information about the lldb-commits
mailing list