<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:
@@ -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