mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
[MCJIT] Re-enable GDB registration (temporarily disabled in r222811), but check
that we actually have an object to register first. For MachO objects, RuntimeDyld::LoadedObjectInfo::getObjectForDebug returns an empty OwningBinary<ObjectFile> which was causing crashes in the GDB registration code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222812 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
11f81ba6a6
commit
31862ae541
@ -75,6 +75,7 @@ MCJIT::MCJIT(std::unique_ptr<Module> M, std::unique_ptr<TargetMachine> tm,
|
||||
|
||||
OwnedModules.addModule(std::move(First));
|
||||
setDataLayout(TM->getSubtargetImpl()->getDataLayout());
|
||||
RegisterJITEventListener(JITEventListener::createGDBRegistrationListener());
|
||||
}
|
||||
|
||||
MCJIT::~MCJIT() {
|
||||
|
@ -151,6 +151,11 @@ void GDBJITRegistrationListener::NotifyObjectEmitted(
|
||||
const RuntimeDyld::LoadedObjectInfo &L) {
|
||||
|
||||
OwningBinary<ObjectFile> DebugObj = L.getObjectForDebug(Object);
|
||||
|
||||
// Bail out if debug objects aren't supported.
|
||||
if (!DebugObj.getBinary())
|
||||
return;
|
||||
|
||||
const char *Buffer = DebugObj.getBinary()->getMemoryBufferRef().getBufferStart();
|
||||
size_t Size = DebugObj.getBinary()->getMemoryBufferRef().getBufferSize();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user