diff options
author | Enrico Granata <egranata@apple.com> | 2013-04-22 18:26:52 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2013-04-22 18:26:52 +0000 |
commit | cbd79b6c8490f92c749512dbaf5cd8452e3941e4 (patch) | |
tree | 85c88067f4a7d4e066e7f81131839841176db897 /lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp | |
parent | 2ec1b100a477326b5ab2a6cb2dd41658e4bb49a7 (diff) | |
download | bcm5719-llvm-cbd79b6c8490f92c749512dbaf5cd8452e3941e4.tar.gz bcm5719-llvm-cbd79b6c8490f92c749512dbaf5cd8452e3941e4.zip |
<rdar://problem/13590152>
Providing a dummy RegisterContext to secure against faulty Python OS plugins that do not return a valid RegisterContext
The RegisterContextDummy exports a PC with a constant 0xFFFFFFFFFFFFFFFF value
llvm-svn: 180033
Diffstat (limited to 'lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp')
-rw-r--r-- | lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp index 6e2aadb7fde..a7aaedb9a0c 100644 --- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp +++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp @@ -33,6 +33,7 @@ #include "lldb/Target/ThreadList.h" #include "lldb/Target/Thread.h" #include "Plugins/Process/Utility/DynamicRegisterInfo.h" +#include "Plugins/Process/Utility/RegisterContextDummy.h" #include "Plugins/Process/Utility/RegisterContextMemory.h" #include "Plugins/Process/Utility/ThreadMemory.h" @@ -333,6 +334,13 @@ OperatingSystemPython::CreateRegisterContextForThread (Thread *thread, addr_t re } } } + // if we still have no register data, fallback on a dummy context to avoid crashing + if (!reg_ctx_sp) + { + if (log) + log->Printf ("OperatingSystemPython::CreateRegisterContextForThread (tid = 0x%" PRIx64 ") forcing a dummy register context", thread->GetID()); + reg_ctx_sp.reset(new RegisterContextDummy(*thread,0,target.GetArchitecture().GetAddressByteSize())); + } return reg_ctx_sp; } |