diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 44764e86c5acff7893f6241d75fed7b8e7c141dd..3f2ce59168fdffe6b0ad5a6e6baa3263d06fdebf 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -1545,19 +1545,24 @@ void GdbEngine::handleHasPython(const GdbResponse &response) const GdbMi hasInferiorThreadList = data.findChild("hasInferiorThreadList"); m_hasInferiorThreadList = (hasInferiorThreadList.data().toInt() != 0); } else { - m_hasPython = false; - if (m_gdbAdapter->dumperHandling() - == AbstractGdbAdapter::DumperLoadedByGdbPreload - && checkDebuggingHelpersClassic()) { - QByteArray cmd = "set environment "; - cmd += Debugger::Constants::Internal::LD_PRELOAD_ENV_VAR; - cmd += ' '; - cmd += startParameters().startMode == StartRemoteGdb - ? startParameters().remoteDumperLib - : qtDumperLibraryName().toLocal8Bit(); - postCommand(cmd); - m_debuggingHelperState = DebuggingHelperLoadTried; - } + pythonDumpersFailed(); + } +} + +void GdbEngine::pythonDumpersFailed() +{ + m_hasPython = false; + if (m_gdbAdapter->dumperHandling() + == AbstractGdbAdapter::DumperLoadedByGdbPreload + && checkDebuggingHelpersClassic()) { + QByteArray cmd = "set environment "; + cmd += Debugger::Constants::Internal::LD_PRELOAD_ENV_VAR; + cmd += ' '; + cmd += startParameters().startMode == StartRemoteGdb + ? startParameters().remoteDumperLib + : qtDumperLibraryName().toLocal8Bit(); + postCommand(cmd); + m_debuggingHelperState = DebuggingHelperLoadTried; } } @@ -4156,10 +4161,12 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &gdb, const QStr "dyld \".*CFDataFormatters.*\" all " "dyld \".*libobjc.*\" all " "dyld \".*CarbonDataFormatters.*\" all"); + // We know that we don't have Python on Mac. + pythonDumpersFailed(); + } else { + loadPythonDumpers(); } - loadPythonDumpers(); - QString scriptFileName = theDebuggerStringSetting(GdbScriptFile); if (!scriptFileName.isEmpty()) { if (QFileInfo(scriptFileName).isReadable()) { @@ -4190,11 +4197,6 @@ void GdbEngine::loadPythonDumpers() ConsoleCommand, CB(handleHasPython)); } -bool GdbEngine::checkDebuggingHelpers() -{ - return !hasPython() && checkDebuggingHelpersClassic(); -} - void GdbEngine::handleGdbError(QProcess::ProcessError error) { const QString msg = errorMessage(error); diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index 2def4f25bdf095f7e7b3d786d8caa43bf5540583..c4b90b80da87bb69ad4693efa7c1b69242d38355 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -138,6 +138,7 @@ private: ////////// Gdb Process Management ////////// void handleAdapterStarted(); void defaultInferiorShutdown(const char *cmd); void loadPythonDumpers(); + void pythonDumpersFailed(); // Something went wrong with the adapter *before* adapterStarted() was emitted. // Make sure to clean up everything before emitting this signal. @@ -511,8 +512,7 @@ private: ////////// View & Data Stuff ////////// // // Dumper Management // - bool checkDebuggingHelpers(); - bool checkDebuggingHelpersClassic(); + bool checkDebuggingHelpersClassic(); void setDebuggingHelperStateClassic(DebuggingHelperState); void tryLoadDebuggingHelpersClassic(); void tryQueryDebuggingHelpersClassic();