forked from qt-creator/qt-creator
Fixes: debugger: put error message into log if loading of dumpers
failed
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
// retreive list of dumpable classes
|
if (m_dataDumperState == DataDumperLoadTried) {
|
||||||
sendCommand("call qDumpObjectData440(1,%1+1,0,0,0,0,0,0)",
|
// retreive list of dumpable classes
|
||||||
GdbQueryDataDumper1);
|
sendCommand("call qDumpObjectData440(1,%1+1,0,0,0,0,0,0)",
|
||||||
sendCommand("p (char*)qDumpOutBuffer", GdbQueryDataDumper2);
|
GdbQueryDataDumper1);
|
||||||
|
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()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user