Fixes: debugger: put error message into log if loading of dumpers

failed
This commit is contained in:
hjk
2009-02-13 14:45:46 +01:00
parent ce652e8ffc
commit 50d486685c

View File

@@ -3946,11 +3946,12 @@ void GdbEngine::tryLoadCustomDumpers()
return; return;
PENDING_DEBUG("TRY LOAD CUSTOM DUMPERS"); PENDING_DEBUG("TRY LOAD CUSTOM DUMPERS");
m_dataDumperState = DataDumperLoadTried; m_dataDumperState = DataDumperUnavailable;
#if defined(Q_OS_LINUX) #if defined(Q_OS_LINUX)
QString lib = q->m_buildDir + "/qtc-gdbmacros/libgdbmacros.so"; QString lib = q->m_buildDir + "/qtc-gdbmacros/libgdbmacros.so";
if (QFileInfo(lib).isExecutable()) { if (QFileInfo(lib).exists()) {
m_dataDumperState = DataDumperLoadTried;
//sendCommand("p dlopen"); //sendCommand("p dlopen");
QString flag = QString::number(RTLD_NOW); QString flag = QString::number(RTLD_NOW);
sendCommand("sharedlibrary libc"); // for malloc sendCommand("sharedlibrary libc"); // for malloc
@@ -3961,44 +3962,44 @@ void GdbEngine::tryLoadCustomDumpers()
sendCommand("call (void)__dlopen(\"" + lib + "\", " + flag + ")", sendCommand("call (void)__dlopen(\"" + lib + "\", " + flag + ")",
WatchDumpCustomSetup); WatchDumpCustomSetup);
sendCommand("sharedlibrary " + dotEscape(lib)); sendCommand("sharedlibrary " + dotEscape(lib));
} else {
qDebug() << "DEBUG HELPER LIBRARY IS NOT USABLE: "
<< lib << QFileInfo(lib).isExecutable();
} }
#endif #endif
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)
QString lib = q->m_buildDir + "/qtc-gdbmacros/libgdbmacros.dylib"; QString lib = q->m_buildDir + "/qtc-gdbmacros/libgdbmacros.dylib";
if (QFileInfo(lib).isExecutable()) { if (QFileInfo(lib).exists()) {
m_dataDumperState = DataDumperLoadTried;
sendCommand("sharedlibrary libc"); // for malloc sendCommand("sharedlibrary libc"); // for malloc
sendCommand("sharedlibrary libdl"); // for dlopen sendCommand("sharedlibrary libdl"); // for dlopen
QString flag = QString::number(RTLD_NOW); QString flag = QString::number(RTLD_NOW);
sendCommand("call (void)dlopen(\"" + lib + "\", " + flag + ")", sendCommand("call (void)dlopen(\"" + lib + "\", " + flag + ")",
WatchDumpCustomSetup); WatchDumpCustomSetup);
sendCommand("sharedlibrary " + dotEscape(lib)); sendCommand("sharedlibrary " + dotEscape(lib));
} else {
qDebug() << "DEBUG HELPER LIBRARY IS NOT USABLE: "
<< lib << QFileInfo(lib).isExecutable();
} }
#endif #endif
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
QString lib = q->m_buildDir + "/qtc-gdbmacros/debug/gdbmacros.dll"; QString lib = q->m_buildDir + "/qtc-gdbmacros/debug/gdbmacros.dll";
if (QFileInfo(lib).exists()) { if (QFileInfo(lib).exists()) {
m_dataDumperState = DataDumperLoadTried;
sendCommand("sharedlibrary .*"); // for LoadLibraryA sendCommand("sharedlibrary .*"); // for LoadLibraryA
//sendCommand("handle SIGSEGV pass stop print"); //sendCommand("handle SIGSEGV pass stop print");
//sendCommand("set unwindonsignal off"); //sendCommand("set unwindonsignal off");
sendCommand("call LoadLibraryA(\"" + lib + "\")", sendCommand("call LoadLibraryA(\"" + lib + "\")",
WatchDumpCustomSetup); WatchDumpCustomSetup);
sendCommand("sharedlibrary " + dotEscape(lib)); sendCommand("sharedlibrary " + dotEscape(lib));
} else {
qDebug() << "DEBUG HELPER LIBRARY IS NOT USABLE: "
<< lib << QFileInfo(lib).isExecutable();
} }
#endif #endif
if (m_dataDumperState == DataDumperLoadTried) {
// retreive list of dumpable classes // retreive list of dumpable classes
sendCommand("call qDumpObjectData440(1,%1+1,0,0,0,0,0,0)", sendCommand("call qDumpObjectData440(1,%1+1,0,0,0,0,0,0)",
GdbQueryDataDumper1); GdbQueryDataDumper1);
sendCommand("p (char*)qDumpOutBuffer", GdbQueryDataDumper2); sendCommand("p (char*)qDumpOutBuffer", GdbQueryDataDumper2);
} else {
gdbOutputAvailable("", QString("DEBUG HELPER LIBRARY IS NOT USABLE: "
" %1 EXISTS: %2, EXECUTABLE: %3").arg(lib)
.arg(QFileInfo(lib).exists())
.arg(QFileInfo(lib).isExecutable()));
}
} }