diff options
| author | Alex Langford <alangford@apple.com> | 2023-06-09 16:27:49 -0700 |
|---|---|---|
| committer | Alex Langford <alangford@apple.com> | 2023-06-15 10:51:17 -0700 |
| commit | 35b0b244401aad5ca3a16c9e4d97a5892ca7592b (patch) | |
| tree | 63ba9ba63b06bcf36d4e89445b5abc6bb03eafab /lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp | |
| parent | c8ac14d754088b19c659ca0915229f1f28776831 (diff) | |
| download | llvm-35b0b244401aad5ca3a16c9e4d97a5892ca7592b.zip llvm-35b0b244401aad5ca3a16c9e4d97a5892ca7592b.tar.gz llvm-35b0b244401aad5ca3a16c9e4d97a5892ca7592b.tar.bz2 | |
[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/OperatingSystemPython.cpp')
| -rw-r--r-- | lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp | 3 |
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 c22003f..9560ae1 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); } |
