mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-29 02:21:19 +00:00
<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
This commit is contained in:
1 parent
2ec1b100a4
commit
cbd79b6c84
4 files changed
+230
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user