From 01bc302c48334b433f66c01b0694756025148908 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 23 Jan 2018 12:55:31 +0100 Subject: [PATCH] Debugger: Do not add CrtDbgReport breakpoints for vc19 The symbol isn't safely resolvable and can lead to unwanted breaks. Task-number: QTCREATORBUG-19628 Change-Id: Iaa58b12cb826a9e20faa64454e806ecab9d613f3 Reviewed-by: hjk Reviewed-by: Christian Stenger --- src/plugins/debugger/cdb/cdbengine.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 3b3ec7d08ee..31e10d0bc03 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -649,12 +649,17 @@ void CdbEngine::runEngine() // else the debugger will slow down considerably. const auto cb = [this](const DebuggerResponse &r) { handleBreakInsert(r, BreakpointModelId()); }; if (boolSetting(CdbBreakOnCrtDbgReport)) { - const QString module = msvcRunTime(runParameters().toolChainAbi.osFlavor()); - const QString debugModule = module + 'D'; - const QString wideFunc = QString::fromLatin1(CdbOptionsPage::crtDbgReport).append('W'); - runCommand({breakAtFunctionCommand(QLatin1String(CdbOptionsPage::crtDbgReport), module), BuiltinCommand, cb}); - runCommand({breakAtFunctionCommand(wideFunc, module), BuiltinCommand, cb}); - runCommand({breakAtFunctionCommand(QLatin1String(CdbOptionsPage::crtDbgReport), debugModule), BuiltinCommand, cb}); + Abi::OSFlavor flavor = runParameters().toolChainAbi.osFlavor(); + // CrtDebugReport can not be safely resolved for vc 19 + if ((flavor > Abi::WindowsMsvc2005Flavor && flavor <= Abi::WindowsMsvc2013Flavor) || + flavor > Abi::WindowsMSysFlavor || flavor <= Abi::WindowsCEFlavor) { + const QString module = msvcRunTime(flavor); + const QString debugModule = module + 'D'; + const QString wideFunc = QString::fromLatin1(CdbOptionsPage::crtDbgReport).append('W'); + runCommand({breakAtFunctionCommand(QLatin1String(CdbOptionsPage::crtDbgReport), module), BuiltinCommand, cb}); + runCommand({breakAtFunctionCommand(wideFunc, module), BuiltinCommand, cb}); + runCommand({breakAtFunctionCommand(QLatin1String(CdbOptionsPage::crtDbgReport), debugModule), BuiltinCommand, cb}); + } } // if (boolSetting(BreakOnWarning)) { // runCommand({"bm /( QtCored4!qWarning", BuiltinCommand}); // 'bm': All overloads.