summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/gdbengine.cpp
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2009-03-24 12:50:08 +0100
committerhjk <qtc-committer@nokia.com>2009-03-24 12:50:40 +0100
commit60bb3616208f26d93170c709d4ecd55e31ba9b95 (patch)
tree10feeed503f3f59d063907a3633eed80753fb402 /src/plugins/debugger/gdbengine.cpp
parent1682a41869fd090b4ee1d3f7fc4747225e7368fa (diff)
downloadqt-creator-60bb3616208f26d93170c709d4ecd55e31ba9b95.tar.gz
debugger: make position of debugger lib configurable
Diffstat (limited to 'src/plugins/debugger/gdbengine.cpp')
-rw-r--r--src/plugins/debugger/gdbengine.cpp73
1 files changed, 35 insertions, 38 deletions
diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp
index c2c18dec37..535276b326 100644
--- a/src/plugins/debugger/gdbengine.cpp
+++ b/src/plugins/debugger/gdbengine.cpp
@@ -4232,7 +4232,7 @@ void GdbEngine::assignValueInDebugger(const QString &expression, const QString &
QString GdbEngine::dumperLibraryName() const
{
- if (theDebuggerAction(UsePrebuiltDumpers))
+ if (theDebuggerAction(UsePrebuiltDumpers)->value().toBool())
return theDebuggerAction(PrebuiltDumpersLocation)->value().toString();
#if defined(Q_OS_WIN)
return q->m_buildDir + "/qtc-gdbmacros/debug/gdbmacros.dll";
@@ -4252,48 +4252,45 @@ void GdbEngine::tryLoadCustomDumpers()
m_dataDumperState = DataDumperUnavailable;
QString lib = dumperLibraryName();
- if (QFileInfo(lib).exists()) {
-#if defined(Q_OS_WIN)
- m_dataDumperState = DataDumperLoadTried;
- sendCommand("sharedlibrary .*"); // for LoadLibraryA
- //sendCommand("handle SIGSEGV pass stop print");
- //sendCommand("set unwindonsignal off");
- sendCommand("call LoadLibraryA(\"" + lib + "\")",
- WatchDumpCustomSetup);
- sendCommand("sharedlibrary " + dotEscape(lib));
-#elif defined(Q_OS_MAC)
- m_dataDumperState = DataDumperLoadTried;
- //sendCommand("sharedlibrary libc"); // for malloc
- //sendCommand("sharedlibrary libdl"); // for dlopen
- QString flag = QString::number(RTLD_NOW);
- sendCommand("call (void)dlopen(\"" + lib + "\", " + flag + ")",
- WatchDumpCustomSetup);
- //sendCommand("sharedlibrary " + dotEscape(lib));
- m_dataDumperState = DataDumperLoadTried;
-#else
- //sendCommand("p dlopen");
- QString flag = QString::number(RTLD_NOW);
- sendCommand("sharedlibrary libc"); // for malloc
- sendCommand("sharedlibrary libdl"); // for dlopen
- sendCommand("call (void)dlopen(\"" + lib + "\", " + flag + ")",
- WatchDumpCustomSetup);
- // some older systems like CentOS 4.6 prefer this:
- sendCommand("call (void)__dlopen(\"" + lib + "\", " + flag + ")",
- WatchDumpCustomSetup);
- sendCommand("sharedlibrary " + dotEscape(lib));
-#endif
- }
-
- if (m_dataDumperState == DataDumperLoadTried) {
- // retreive list of dumpable classes
- sendCommand("call qDumpObjectData440(1,%1+1,0,0,0,0,0,0)");
- sendCommand("p (char*)qDumpOutBuffer", GdbQueryDataDumper);
- } else {
+ if (!QFileInfo(lib).exists()) {
debugMessage(QString("DEBUG HELPER LIBRARY IS NOT USABLE: "
" %1 EXISTS: %2, EXECUTABLE: %3").arg(lib)
.arg(QFileInfo(lib).exists())
.arg(QFileInfo(lib).isExecutable()));
+ return;
}
+
+ m_dataDumperState = DataDumperLoadTried;
+#if defined(Q_OS_WIN)
+ sendCommand("sharedlibrary .*"); // for LoadLibraryA
+ //sendCommand("handle SIGSEGV pass stop print");
+ //sendCommand("set unwindonsignal off");
+ sendCommand("call LoadLibraryA(\"" + lib + "\")",
+ WatchDumpCustomSetup);
+ sendCommand("sharedlibrary " + dotEscape(lib));
+#elif defined(Q_OS_MAC)
+ //sendCommand("sharedlibrary libc"); // for malloc
+ //sendCommand("sharedlibrary libdl"); // for dlopen
+ QString flag = QString::number(RTLD_NOW);
+ sendCommand("call (void)dlopen(\"" + lib + "\", " + flag + ")",
+ WatchDumpCustomSetup);
+ //sendCommand("sharedlibrary " + dotEscape(lib));
+ m_dataDumperState = DataDumperLoadTried;
+#else
+ //sendCommand("p dlopen");
+ QString flag = QString::number(RTLD_NOW);
+ sendCommand("sharedlibrary libc"); // for malloc
+ sendCommand("sharedlibrary libdl"); // for dlopen
+ sendCommand("call (void)dlopen(\"" + lib + "\", " + flag + ")",
+ WatchDumpCustomSetup);
+ // some older systems like CentOS 4.6 prefer this:
+ sendCommand("call (void)__dlopen(\"" + lib + "\", " + flag + ")",
+ WatchDumpCustomSetup);
+ sendCommand("sharedlibrary " + dotEscape(lib));
+#endif
+ // retreive list of dumpable classes
+ sendCommand("call qDumpObjectData440(1,%1+1,0,0,0,0,0,0)");
+ sendCommand("p (char*)qDumpOutBuffer", GdbQueryDataDumper);
}
void GdbEngine::recheckCustomDumperAvailability()