aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/OperatingSystem/Python
diff options
context:
space:
mode:
authorAlex Langford <alangford@apple.com>2023-06-09 16:27:49 -0700
committerAlex Langford <alangford@apple.com>2023-06-15 10:51:17 -0700
commit35b0b244401aad5ca3a16c9e4d97a5892ca7592b (patch)
tree63ba9ba63b06bcf36d4e89445b5abc6bb03eafab /lldb/source/Plugins/OperatingSystem/Python
parentc8ac14d754088b19c659ca0915229f1f28776831 (diff)
downloadllvm-35b0b244401aad5ca3a16c9e4d97a5892ca7592b.tar.gz
llvm-35b0b244401aad5ca3a16c9e4d97a5892ca7592b.tar.bz2
llvm-35b0b244401aad5ca3a16c9e4d97a5892ca7592b.zip
[lldb] Introduce DynamicRegisterInfo::CreateFromDict
I want to add some error handling to DynamicRegisterInfo because there are many operations that can fail and many of these operations do not give meaningful information back to the caller. To begin that process, I want to add a static method that is responsible for creating a DynamicRegisterInfo from a StructuredData::Dictionary (and ArchSpec). This is meant to replace the equivalent constructor because constructors are ill-equipped to perform error handling. Differential Revision: https://reviews.llvm.org/D152594
Diffstat (limited to 'lldb/source/Plugins/OperatingSystem/Python')
-rw-r--r--lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
index c22003f24f76..9560ae108f3e 100644
--- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
+++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
@@ -128,8 +128,9 @@ DynamicRegisterInfo *OperatingSystemPython::GetDynamicRegisterInfo() {
if (!dictionary)
return nullptr;
- m_register_info_up = std::make_unique<DynamicRegisterInfo>(
+ m_register_info_up = DynamicRegisterInfo::Create(
*dictionary, m_process->GetTarget().GetArchitecture());
+ assert(m_register_info_up);
assert(m_register_info_up->GetNumRegisters() > 0);
assert(m_register_info_up->GetNumRegisterSets() > 0);
}