diff options
author | hjk <qthjk@ovi.com> | 2012-08-09 04:47:47 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2012-08-12 22:43:24 +0200 |
commit | e7fea1aa7a381ad4b649a97a33b668d021fd7878 (patch) | |
tree | 003db638d70f6d51d2dc1737bd2128b85455acd2 /src | |
parent | ac9458e664bb56e12b2fb712eecc2ae61bde550a (diff) | |
download | qt-creator-e7fea1aa7a381ad4b649a97a33b668d021fd7878.tar.gz |
debugger: streamline classical dumper setup
Remote dumpers are not used anymore, there's also no need to
have it in the engine base class anymore.
Change-Id: If0b6930b07e468d5973d848e02696bc5da40a197
Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/android/androiddebugsupport.cpp | 1 | ||||
-rw-r--r-- | src/plugins/debugger/debuggercore.h | 1 | ||||
-rw-r--r-- | src/plugins/debugger/debuggerengine.cpp | 30 | ||||
-rw-r--r-- | src/plugins/debugger/debuggerengine.h | 6 | ||||
-rw-r--r-- | src/plugins/debugger/debuggerplugin.cpp | 33 | ||||
-rw-r--r-- | src/plugins/debugger/debuggerstartparameters.h | 1 | ||||
-rw-r--r-- | src/plugins/debugger/gdb/classicgdbengine.cpp | 55 | ||||
-rw-r--r-- | src/plugins/debugger/gdb/gdbengine.cpp | 6 | ||||
-rw-r--r-- | src/plugins/debugger/gdb/gdbengine.h | 1 |
9 files changed, 41 insertions, 93 deletions
diff --git a/src/plugins/android/androiddebugsupport.cpp b/src/plugins/android/androiddebugsupport.cpp index 79f81ebaab..95245baadf 100644 --- a/src/plugins/android/androiddebugsupport.cpp +++ b/src/plugins/android/androiddebugsupport.cpp @@ -79,7 +79,6 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration * params.debuggerCommand = DebuggerProfileInformation::debuggerCommand(profile).toString(); if (ToolChain *tc = ToolChainProfileInformation::toolChain(profile)) params.toolChainAbi = tc->targetAbi(); - params.dumperLibrary = runConfig->dumperLib(); params.executable = project(runConfig)->rootQt4ProjectNode()->buildDir() + QLatin1String("/app_process"); params.remoteChannel = runConfig->remoteChannel(); params.useServerStartScript = true; diff --git a/src/plugins/debugger/debuggercore.h b/src/plugins/debugger/debuggercore.h index 2269a98721..cccca02b1f 100644 --- a/src/plugins/debugger/debuggercore.h +++ b/src/plugins/debugger/debuggercore.h @@ -84,7 +84,6 @@ public: virtual void setConfigValue(const QString &name, const QVariant &value) = 0; virtual void updateState(DebuggerEngine *engine) = 0; virtual void updateWatchersWindow(bool showWatch, bool showReturn) = 0; - virtual void showQtDumperLibraryWarning(const QString &details) = 0; virtual QIcon locationMarkIcon() const = 0; virtual const CPlusPlus::Snapshot &cppCodeModelSnapshot() const = 0; virtual bool hasSnapshots() const = 0; diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 9137c60f0f..42189d0a02 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -686,36 +686,6 @@ DebuggerStartParameters &DebuggerEngine::startParameters() return d->m_startParameters; } - -////////////////////////////////////////////////////////////////////// -// -// Dumpers. "Custom dumpers" are a library compiled against the current -// Qt containing functions to evaluate values of Qt classes -// (such as QString, taking pointers to their addresses). -// The library must be loaded into the debuggee. -// -////////////////////////////////////////////////////////////////////// - -bool DebuggerEngine::qtDumperLibraryEnabled() const -{ - return debuggerCore()->boolSetting(UseDebuggingHelpers); -} - -QStringList DebuggerEngine::qtDumperLibraryLocations() const -{ - return d->m_startParameters.dumperLibraryLocations; -} - -void DebuggerEngine::showQtDumperLibraryWarning(const QString &details) -{ - debuggerCore()->showQtDumperLibraryWarning(details); -} - -QString DebuggerEngine::qtDumperLibraryName() const -{ - return startParameters().dumperLibrary; -} - DebuggerState DebuggerEngine::state() const { return d->m_state; diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index eb09084b50..2b7fdbdc0e 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -244,12 +244,6 @@ public: DebuggerState targetState() const; bool isDying() const; - // Dumper stuff (common to cdb and gdb). - bool qtDumperLibraryEnabled() const; - QString qtDumperLibraryName() const; - QStringList qtDumperLibraryLocations() const; - void showQtDumperLibraryWarning(const QString &details); - static const char *stateName(int s); void notifyInferiorPid(qint64 pid); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index f2b15d42e5..6cb43e7ebc 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -795,7 +795,6 @@ public slots: const CPlusPlus::Snapshot &cppCodeModelSnapshot() const; - void showQtDumperLibraryWarning(const QString &details); DebuggerMainWindow *mainWindow() const { return m_mainWindow; } bool isDockVisible(const QString &objectName) const { return mainWindow()->isDockVisible(objectName); } @@ -2558,36 +2557,6 @@ void DebuggerPluginPrivate::showMessage(const QString &msg, int channel, int tim } } -void DebuggerPluginPrivate::showQtDumperLibraryWarning(const QString &details) -{ - QMessageBox dialog(mainWindow()); - QPushButton *qtPref = dialog.addButton(tr("Open Qt Options"), - QMessageBox::ActionRole); - QPushButton *helperOff = dialog.addButton(tr("Turn off Helper Usage"), - QMessageBox::ActionRole); - QPushButton *justContinue = dialog.addButton(tr("Continue Anyway"), - QMessageBox::AcceptRole); - dialog.setDefaultButton(justContinue); - dialog.setWindowTitle(tr("Debugging Helper Missing")); - dialog.setText(tr("The debugger could not load the debugging helper library.")); - dialog.setInformativeText(tr( - "The debugging helper is used to nicely format the values of some Qt " - "and Standard Library data types. " - "It must be compiled for each used Qt version separately. " - "In the Qt Creator Build and Run preferences page, select a Qt version, " - "expand the Details section and click Build All.")); - if (!details.isEmpty()) - dialog.setDetailedText(details); - dialog.exec(); - if (dialog.clickedButton() == qtPref) { - ICore::showOptionsDialog( - _(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY), - _(QtSupport::Constants::QTVERSION_SETTINGS_PAGE_ID)); - } else if (dialog.clickedButton() == helperOff) { - action(UseDebuggingHelpers)->setValue(qVariantFromValue(false), false); - } -} - void DebuggerPluginPrivate::createNewDock(QWidget *widget) { QDockWidget *dockWidget = @@ -2646,8 +2615,6 @@ static QString formatStartParameters(DebuggerStartParameters &sp) << sp.qmlServerPort << '\n'; if (!sp.remoteChannel.isEmpty()) { str << "Remote: " << sp.remoteChannel << '\n'; - if (!sp.remoteDumperLib.isEmpty()) - str << "Remote dumpers: " << sp.remoteDumperLib << '\n'; if (!sp.remoteSourcesDir.isEmpty()) str << "Remote sources: " << sp.remoteSourcesDir << '\n'; if (!sp.remoteMountPoint.isEmpty()) diff --git a/src/plugins/debugger/debuggerstartparameters.h b/src/plugins/debugger/debuggerstartparameters.h index 30bd8d8db4..14aeb0a4b0 100644 --- a/src/plugins/debugger/debuggerstartparameters.h +++ b/src/plugins/debugger/debuggerstartparameters.h @@ -115,7 +115,6 @@ public: QString searchPath; // Gdb "set solib-search-path" QString debugInfoLocation; // Gdb "set-debug-file-directory". QStringList debugSourceLocation; // Gdb "directory" - QByteArray remoteDumperLib; QByteArray remoteSourcesDir; QString remoteMountPoint; QString localMountDir; diff --git a/src/plugins/debugger/gdb/classicgdbengine.cpp b/src/plugins/debugger/gdb/classicgdbengine.cpp index c8ea030118..bdce5a52e0 100644 --- a/src/plugins/debugger/gdb/classicgdbengine.cpp +++ b/src/plugins/debugger/gdb/classicgdbengine.cpp @@ -39,6 +39,8 @@ #include "stackhandler.h" #include "watchhandler.h" +#include <coreplugin/icore.h> +#include <qtsupport/qtsupportconstants.h> #include <utils/qtcassert.h> #include <utils/savedaction.h> #include <utils/fileutils.h> @@ -46,6 +48,7 @@ #include <QFile> #include <QFileInfo> #include <QMessageBox> +#include <QPushButton> #if !defined(Q_OS_WIN) #include <dlfcn.h> @@ -1118,18 +1121,13 @@ void GdbEngine::tryLoadDebuggingHelpersClassic() return; m_debuggingHelperState = DebuggingHelperLoadTried; - QByteArray dlopenLib; - const DebuggerStartMode startMode = startParameters().startMode; - if (startMode == AttachToRemoteServer || startMode == StartRemoteGdb) - dlopenLib = startParameters().remoteDumperLib; - else - dlopenLib = qtDumperLibraryName().toLocal8Bit(); // Do not use STRINGIFY for RTLD_NOW as we really want to expand that to a number. #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) // We are using Python on Windows and Symbian. QTC_CHECK(false); #elif defined(Q_OS_MAC) + QByteArray dlopenLib = startParameters().dumperLibrary.toLocal8Bit(); //postCommand("sharedlibrary libc"); // for malloc //postCommand("sharedlibrary libdl"); // for dlopen const QByteArray flag = QByteArray::number(RTLD_NOW); @@ -1138,6 +1136,7 @@ void GdbEngine::tryLoadDebuggingHelpersClassic() CB(handleDebuggingHelperSetup)); //postCommand("sharedlibrary " + dotEscape(dlopenLib)); #else + QByteArray dlopenLib = startParameters().dumperLibrary.toLocal8Bit(); //postCommand("p dlopen"); const QByteArray flag = QByteArray::number(RTLD_NOW); postCommand("sharedlibrary libc"); // for malloc @@ -1151,16 +1150,10 @@ void GdbEngine::tryLoadDebuggingHelpersClassic() CB(handleDebuggingHelperSetup)); postCommand("sharedlibrary " + dotEscape(dlopenLib)); #endif - tryQueryDebuggingHelpersClassic(); -} -void GdbEngine::tryQueryDebuggingHelpersClassic() -{ - PRECONDITION; // Retrieve list of dumpable classes. postCommand("call (void*)qDumpObjectData440(1,0,0,0,0,0,0,0)"); - postCommand("p (char*)&qDumpOutBuffer", - CB(handleQueryDebuggingHelperClassic)); + postCommand("p (char*)&qDumpOutBuffer", CB(handleQueryDebuggingHelperClassic)); } // Called from CoreAdapter and AttachAdapter @@ -1267,15 +1260,45 @@ void GdbEngine::handleStackListLocalsClassic(const GdbResponse &response) watchHandler()->updateWatchers(); } +static void showQtDumperLibraryWarning(const QString &details) +{ + QMessageBox dialog(debuggerCore()->mainWindow()); + QPushButton *qtPref = dialog.addButton(DebuggerCore::tr("Open Qt Options"), + QMessageBox::ActionRole); + QPushButton *helperOff = dialog.addButton(DebuggerCore::tr("Turn off Helper Usage"), + QMessageBox::ActionRole); + QPushButton *justContinue = dialog.addButton(DebuggerCore::tr("Continue Anyway"), + QMessageBox::AcceptRole); + dialog.setDefaultButton(justContinue); + dialog.setWindowTitle(DebuggerCore::tr("Debugging Helper Missing")); + dialog.setText(DebuggerCore::tr("The debugger could not load the debugging helper library.")); + dialog.setInformativeText(DebuggerCore::tr( + "The debugging helper is used to nicely format the values of some Qt " + "and Standard Library data types. " + "It must be compiled for each used Qt version separately. " + "In the Qt Creator Build and Run preferences page, select a Qt version, " + "expand the Details section and click Build All.")); + if (!details.isEmpty()) + dialog.setDetailedText(details); + dialog.exec(); + if (dialog.clickedButton() == qtPref) { + Core::ICore::showOptionsDialog( + _(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY), + _(QtSupport::Constants::QTVERSION_SETTINGS_PAGE_ID)); + } else if (dialog.clickedButton() == helperOff) { + debuggerCore()->action(UseDebuggingHelpers)->setValue(qVariantFromValue(false), false); + } +} + bool GdbEngine::checkDebuggingHelpersClassic() { PRECONDITION; - if (!qtDumperLibraryEnabled()) + if (!debuggerCore()->boolSetting(UseDebuggingHelpers)) return false; - const QString lib = qtDumperLibraryName(); + const QString lib = startParameters().dumperLibrary; if (QFileInfo(lib).exists()) return true; - const QStringList &locations = qtDumperLibraryLocations(); + const QStringList &locations = startParameters().dumperLibraryLocations; const QString loc = locations.join(QLatin1String(", ")); const QString msg = tr("The debugging helper library was not found at %1.") .arg(loc); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 482ca8d408..aeca1401de 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -1851,10 +1851,8 @@ void GdbEngine::pythonDumpersFailed() else cmd += "LD_PRELOAD"; cmd += ' '; - if (sp.startMode == StartRemoteGdb) - cmd += sp.remoteDumperLib; - else - cmd += qtDumperLibraryName().toLocal8Bit(); + if (sp.startMode != StartRemoteGdb) + cmd += sp.dumperLibrary.toLocal8Bit(); postCommand(cmd); m_debuggingHelperState = DebuggingHelperLoadTried; } diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index 2589dfa93e..71d364b7aa 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -646,7 +646,6 @@ protected: bool checkDebuggingHelpersClassic(); void setDebuggingHelperStateClassic(DebuggingHelperState); void tryLoadDebuggingHelpersClassic(); - void tryQueryDebuggingHelpersClassic(); DebuggingHelperState m_debuggingHelperState; DumperHelper m_dumperHelper; |