[MCJIT] Re-enable GDB registration (temporarily disabled in r222811), but check
[oota-llvm.git] / lib / ExecutionEngine / RuntimeDyld / GDBRegistrationListener.cpp
index 641d3a2..13d5672 100644 (file)
@@ -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();