diff --git a/src/plugins/debugger/gdb/classicgdbengine.cpp b/src/plugins/debugger/gdb/classicgdbengine.cpp index 20f15288e21..a04d66152bf 100644 --- a/src/plugins/debugger/gdb/classicgdbengine.cpp +++ b/src/plugins/debugger/gdb/classicgdbengine.cpp @@ -104,12 +104,6 @@ void GdbEngine::updateLocalsClassic(const QVariant &cookie) m_toolTipExpression.clear(); manager()->watchHandler()->beginCycle(); - // Asynchronous load of injected library, initialize in first stop - if (m_dumperInjectionLoad && m_debuggingHelperState == DebuggingHelperLoadTried - && m_dumperHelper.typeCount() == 0 - && inferiorPid() > 0) - tryQueryDebuggingHelpersClassic(); - QByteArray level = QByteArray::number(currentFrame()); // '2' is 'list with type and value' QByteArray cmd = "-stack-list-arguments 2 " + level + ' ' + level; @@ -492,19 +486,6 @@ void GdbEngine::handleDebuggingHelperValue3Classic(const GdbResponse &response) void GdbEngine::tryLoadDebuggingHelpersClassic() { PRECONDITION; - if (isSynchroneous()) - return; - switch (m_debuggingHelperState) { - case DebuggingHelperUninitialized: - break; - case DebuggingHelperLoadTried: - tryQueryDebuggingHelpersClassic(); - return; - case DebuggingHelperAvailable: - case DebuggingHelperUnavailable: - return; - } - if (m_gdbAdapter->dumperHandling() == AbstractGdbAdapter::DumperNotAvailable) { // Load at least gdb macro based dumpers. QFile file(_(":/gdb/gdbmacros.txt")); @@ -514,8 +495,6 @@ void GdbEngine::tryLoadDebuggingHelpersClassic() postCommand(contents); return; } - if (m_dumperInjectionLoad && inferiorPid() <= 0) // Need PID to inject - return; PENDING_DEBUG("TRY LOAD CUSTOM DUMPERS"); m_debuggingHelperState = DebuggingHelperUnavailable; @@ -529,32 +508,8 @@ void GdbEngine::tryLoadDebuggingHelpersClassic() else dlopenLib = manager()->qtDumperLibraryName().toLocal8Bit(); #if defined(Q_OS_WIN) - if (m_dumperInjectionLoad) { - /// Launch asynchronous remote thread to load. - SharedLibraryInjector injector(inferiorPid()); - QString errorMessage; - const QString dlopenLibString = _(dlopenLib); - if (injector.remoteInject(dlopenLibString, false, &errorMessage)) { - debugMessage(_("Dumper injection loading triggered (%1)..."). - arg(dlopenLibString)); - } else { - debugMessage(_("Dumper loading (%1) failed: %2"). - arg(dlopenLibString, errorMessage)); - debugMessage(errorMessage); - manager()->showQtDumperLibraryWarning(errorMessage); - m_debuggingHelperState = DebuggingHelperUnavailable; - return; - } - } else { - debugMessage(_("Loading dumpers via debugger call (%1)..."). - arg(_(dlopenLib))); - postCommand("sharedlibrary .*"); // for LoadLibraryA - //postCommand("handle SIGSEGV pass stop print"); - //postCommand("set unwindonsignal off"); - postCommand("call LoadLibraryA(\"" + GdbMi::escapeCString(dlopenLib) + "\")", - CB(handleDebuggingHelperSetup)); - postCommand("sharedlibrary " + dotEscape(dlopenLib)); - } + // We are using Python on Windows. + QTC_ASSERT(false, /**/); #elif defined(Q_OS_MAC) //postCommand("sharedlibrary libc"); // for malloc //postCommand("sharedlibrary libdl"); // for dlopen @@ -575,8 +530,7 @@ void GdbEngine::tryLoadDebuggingHelpersClassic() CB(handleDebuggingHelperSetup)); postCommand("sharedlibrary " + dotEscape(dlopenLib)); #endif - if (!m_dumperInjectionLoad) - tryQueryDebuggingHelpersClassic(); + tryQueryDebuggingHelpersClassic(); } void GdbEngine::tryQueryDebuggingHelpersClassic() @@ -750,12 +704,13 @@ void GdbEngine::handleQueryDebuggingHelperClassic(const GdbResponse &response) 0, m_dumperHelper.typeCount()).arg(dumperVersion); showStatusMessage(successMsg); } else { - if (!m_dumperInjectionLoad) // Retry if thread has not terminated yet. - m_debuggingHelperState = DebuggingHelperUnavailable; + // Retry if thread has not terminated yet. + m_debuggingHelperState = DebuggingHelperUnavailable; showStatusMessage(tr("Debugging helpers not found.")); } //qDebug() << m_dumperHelper.toString(true); //qDebug() << m_availableSimpleDebuggingHelpers << "DATA DUMPERS AVAILABLE"; } + } // namespace Internal } // namespace Debugger diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 7d25d9d00d9..8feca0953f8 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -80,9 +80,6 @@ #include #include #include -#ifdef Q_OS_WIN -# include "shared/sharedlibraryinjector.h" -#endif #ifdef Q_OS_UNIX #include @@ -179,13 +176,7 @@ static QByteArray parsePlainConsoleStream(const GdbResponse &response) // /////////////////////////////////////////////////////////////////////// -GdbEngine::GdbEngine(DebuggerManager *manager) : - IDebuggerEngine(manager), -#ifdef Q_OS_WIN // Do injection loading with MinGW (call loading does not work with 64bit) - m_dumperInjectionLoad(true) -#else - m_dumperInjectionLoad(false) -#endif +GdbEngine::GdbEngine(DebuggerManager *manager) : IDebuggerEngine(manager) { m_trkOptions = QSharedPointer(new TrkOptions); m_trkOptions->fromSettings(Core::ICore::instance()->settings()); @@ -683,8 +674,6 @@ void GdbEngine::maybeHandleInferiorPidChanged(const QString &pid0) debugMessage(_("FOUND PID %1").arg(pid)); handleInferiorPidChanged(pid); - if (m_dumperInjectionLoad && !hasPython()) - tryLoadDebuggingHelpersClassic(); } void GdbEngine::postCommand(const QByteArray &command, AdapterCallback callback, @@ -1113,8 +1102,7 @@ void GdbEngine::handleAqcuiredInferior() + theDebuggerStringSetting(SelectedPluginBreakpointsPattern)); } else if (theDebuggerBoolSetting(NoPluginBreakpoints)) { // should be like that already - if (!m_dumperInjectionLoad) - postCommand("set auto-solib-add off"); + postCommand("set auto-solib-add off"); postCommand("set stop-on-solib-events 0"); } #endif diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index da0be04d5c2..09aeff5f61e 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -264,6 +264,7 @@ private: ////////// Gdb Output, State & Capability Handling ////////// void handleStop1(const GdbMi &data); StackFrame parseStackFrame(const GdbMi &mi, int level); + bool isSynchroneous() const { return hasPython(); } virtual bool hasPython() const; bool supportsThreads() const; @@ -481,7 +482,6 @@ private: ////////// Dumper Management ////////// Q_SLOT void setDebugDebuggingHelpersClassic(const QVariant &on); Q_SLOT void setUseDebuggingHelpers(const QVariant &on); - const bool m_dumperInjectionLoad; DebuggingHelperState m_debuggingHelperState; QtDumperHelper m_dumperHelper;