OSDN Git Service

fix assertion in CdbDebugEventCallback::UnloadModule
authorJoerg Bornemann <joerg.bornemann@nokia.com>
Tue, 20 Jul 2010 15:35:13 +0000 (17:35 +0200)
committerJoerg Bornemann <joerg.bornemann@nokia.com>
Wed, 21 Jul 2010 12:43:15 +0000 (14:43 +0200)
Parameter ImageBaseName can be NULL.
This seems to happen for modules like kernel32.dll and other
modules in the guts of the OS.

src/plugins/debugger/cdb/cdbdebugeventcallback.cpp

index 4322ac7..ac2e3dd 100644 (file)
@@ -183,10 +183,11 @@ STDMETHODIMP CdbDebugEventCallback::UnloadModule(
     __in ULONG64 BaseOffset
     )
 {
-    Q_UNUSED(ImageBaseName)
     Q_UNUSED(BaseOffset)
     if (debugCDB > 1)
         qDebug() << Q_FUNC_INFO << ImageBaseName;
+    if (!ImageBaseName)
+        return S_OK;
     m_pEngine->m_d->handleModuleUnload(QString::fromUtf16(reinterpret_cast<const ushort *>(ImageBaseName)));
     handleModuleUnload();
     m_pEngine->m_d->updateModules();