diff options
author | Eike Ziller <eike.ziller@qt.io> | 2022-08-24 14:55:12 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2022-08-31 06:25:01 +0000 |
commit | d5bacfc087daed9d869999986ee5bb6502ff63a7 (patch) | |
tree | 263b24e5c0c9bb574bf5465741c7df12461bf482 /src/plugins/debugger/gdb/gdbengine.cpp | |
parent | a29ee883aef1d0b48996195c77bae26a5584c109 (diff) | |
download | qt-creator-d5bacfc087daed9d869999986ee5bb6502ff63a7.tar.gz |
Debugger: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*
And instead of qgetenv.
Takes Qt Creator's setting at "Environment > System > Environment" into
account, which makes it easier on some platforms to set them (e.g.
macOS), can be configured differently in different settings paths, and
potentially can be changed at runtime (depending on usage).
Change-Id: I3ea7623fb528e13a202afa2f89b00e5ee83962d8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/debugger/gdb/gdbengine.cpp')
-rw-r--r-- | src/plugins/debugger/gdb/gdbengine.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index eb77a9034d..65f692dfe5 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -37,6 +37,7 @@ #include <app/app_version.h> #include <utils/algorithm.h> +#include <utils/environment.h> #include <utils/hostosinfo.h> #include <utils/processinterface.h> #include <utils/qtcassert.h> @@ -2599,7 +2600,8 @@ void GdbEngine::insertBreakpoint(const Breakpoint &bp) } // for dumping of expressions - const static bool alwaysVerbose = qEnvironmentVariableIsSet("QTC_DEBUGGER_PYTHON_VERBOSE"); + const bool alwaysVerbose = qtcEnvironmentVariableIsSet( + "QTC_DEBUGGER_PYTHON_VERBOSE"); const DebuggerSettings &s = *debuggerSettings(); cmd.arg("passexceptions", alwaysVerbose); cmd.arg("fancy", s.useDebuggingHelpers.value()); @@ -3810,7 +3812,7 @@ void GdbEngine::setupEngine() gdbCommand.addArg("--tty=" + m_outputCollector.serverName()); } - const QStringList testList = QString::fromLocal8Bit(qgetenv("QTC_DEBUGGER_TESTS")).split(','); + const QStringList testList = qtcEnvironmentVariable("QTC_DEBUGGER_TESTS").split(','); for (const QString &test : testList) m_testCases.insert(test.toInt()); for (int test : qAsConst(m_testCases)) @@ -5044,7 +5046,7 @@ void GdbEngine::doUpdateLocals(const UpdateParameters ¶ms) watchHandler()->appendFormatRequests(&cmd); watchHandler()->appendWatchersAndTooltipRequests(&cmd); - const static bool alwaysVerbose = qEnvironmentVariableIsSet("QTC_DEBUGGER_PYTHON_VERBOSE"); + const bool alwaysVerbose = qtcEnvironmentVariableIsSet("QTC_DEBUGGER_PYTHON_VERBOSE"); const DebuggerSettings &s = *debuggerSettings(); cmd.arg("passexceptions", alwaysVerbose); cmd.arg("fancy", s.useDebuggingHelpers.value()); |