From 65a3e484a905bf3fbac86784dd20ec421fbb401d Mon Sep 17 00:00:00 2001 From: Andrii Semkiv Date: Wed, 4 Dec 2024 15:26:07 +0100 Subject: Debugger: Add an option to control heap debugging Added a checkbox (temporarily) in CDB settings page that toggles the heap debugging on Windows. Although it is "technically" a CDB option, it woks with LLDB on Windows as well. The default behavior is to keep the heap debugging off. The checkbox can still be overridden by the environment variable. Fixes: QTCREATORBUG-32102 Change-Id: I580cd0d66da38776f3a51632ede6b5f60d4d4cfd Reviewed-by: hjk Reviewed-by: David Schulz --- src/plugins/debugger/cdb/cdbengine.cpp | 4 ++++ src/plugins/debugger/cdb/cdboptionspage.cpp | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/plugins/debugger/cdb') diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 16aab0c920c..0dc2d321613 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -406,6 +406,10 @@ void CdbEngine::setupEngine() if (!oldCdbExtensionPath.isEmpty()) inferiorEnvironment.appendOrSet(cdbExtensionPathVariableC, oldCdbExtensionPath); + if (!inferiorEnvironment.hasKey(Debugger::Constants::NO_DEBUG_HEAP)) { + const QString value = s.enableHeapDebugging() ? "0" : "1"; + inferiorEnvironment.set(Debugger::Constants::NO_DEBUG_HEAP, value); + } m_process.setEnvironment(inferiorEnvironment); if (!sp.inferior.workingDirectory.isEmpty()) m_process.setWorkingDirectory(sp.inferior.workingDirectory); diff --git a/src/plugins/debugger/cdb/cdboptionspage.cpp b/src/plugins/debugger/cdb/cdboptionspage.cpp index ef3586e61b6..1cf5a2a2855 100644 --- a/src/plugins/debugger/cdb/cdboptionspage.cpp +++ b/src/plugins/debugger/cdb/cdboptionspage.cpp @@ -171,6 +171,7 @@ CdbOptionsPageWidget::CdbOptionsPageWidget() m_breakEventWidget->setBreakEvents(settings().cdbBreakEvents()); + // clang-format off Column { Row { Group { @@ -188,7 +189,8 @@ CdbOptionsPageWidget::CdbOptionsPageWidget() s.ignoreFirstChanceAccessViolation, s.cdbBreakOnCrtDbgReport, s.cdbBreakPointCorrection, - s.cdbUsePythonDumper + s.cdbUsePythonDumper, + s.enableHeapDebugging } } }, @@ -209,6 +211,7 @@ CdbOptionsPageWidget::CdbOptionsPageWidget() st }.attachTo(this); + // clang-format on } void CdbOptionsPageWidget::apply() -- cgit v1.2.3