Debugger: Require at least Python 3.7

This is somewhat arbitrary as I don't want to bisect down to
what is exactly needed, and this affects only a warning.

Python 3.7 was released 2018-06-27 and is out of support since
2020-06-27 and security fixes up to 2023-06-06, so most
people should already have much newer setups.

[ChangeLog][Debugger] Require Python 3.7 as minimum for GDB support

Change-Id: I433956365965144a7b8e11bbca7d76e0bf25cf69
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
hjk
2025-02-06 15:21:41 +01:00
parent 200074c4ac
commit 9f5d309074
2 changed files with 6 additions and 4 deletions

View File

@@ -65,7 +65,7 @@
\section1 GDB Versions \section1 GDB Versions
Use GDB 7.5, or later, with the Python scripting extension and Python version Use GDB 7.5, or later, with the Python scripting extension and Python version
3.5, or later. 3.7, or later.
For remote debugging using GDB and GDB server, the minimum supported version For remote debugging using GDB and GDB server, the minimum supported version
of GDB server on the target \l{glossary-device}{device} is 7.0. of GDB server on the target \l{glossary-device}{device} is 7.0.

View File

@@ -1511,16 +1511,18 @@ void GdbEngine::handlePythonSetup(const DebuggerResponse &response)
GdbMi data = response.data; GdbMi data = response.data;
watchHandler()->addDumpers(data["dumpers"]); watchHandler()->addDumpers(data["dumpers"]);
m_pythonVersion = data["python"].toInt(); m_pythonVersion = data["python"].toInt();
if (m_pythonVersion < 20700) { if (m_pythonVersion < 30700) {
int pythonMajor = m_pythonVersion / 10000; int pythonMajor = m_pythonVersion / 10000;
int pythonMinor = (m_pythonVersion / 100) % 100; int pythonMinor = (m_pythonVersion / 100) % 100;
QString out = "<p>" QString out = "<p>"
+ Tr::tr("The selected build of GDB supports Python scripting, " + Tr::tr("The selected build of GDB supports Python scripting, "
"but the used version %1.%2 is not sufficient for " "but the used version %1.%2 is not sufficient for "
"%3. Supported versions are Python 2.7 and 3.x.") "%3. Python %4 or later is required.")
.arg(pythonMajor) .arg(pythonMajor)
.arg(pythonMinor) .arg(pythonMinor)
.arg(QGuiApplication::applicationDisplayName()); .arg(QGuiApplication::applicationDisplayName())
.arg("3.7");
showStatusMessage(out); showStatusMessage(out);
AsynchronousMessageBox::critical(Tr::tr("Execution Error"), out); AsynchronousMessageBox::critical(Tr::tr("Execution Error"), out);
} }