From 3261128a94d7b98bfcb8d58be5bb68f85f22281f Mon Sep 17 00:00:00 2001
From: Kai Koehne <kai.koehne@nokia.com>
Date: Mon, 8 Aug 2011 15:38:05 +0200
Subject: [PATCH] Debugger: Don't warn about never-hit breakpoints when loading
 a coredumps

Only check the breakpoints when app was started internally.

Change-Id: I38f0af08a2c137d44a127b254283574277b57eff
Reviewed-on: http://codereview.qt.nokia.com/2751
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: hjk <qthjk@ovi.com>
---
 src/plugins/debugger/debuggerrunner.cpp | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp
index db00eaaa670..6dc3e43a6b5 100644
--- a/src/plugins/debugger/debuggerrunner.cpp
+++ b/src/plugins/debugger/debuggerrunner.cpp
@@ -249,20 +249,22 @@ void DebuggerRunControl::start()
         return;
     }
 
-    foreach (const BreakpointModelId &id, debuggerCore()->breakHandler()->allBreakpointIds()) {
-        if (d->m_engine->breakHandler()->breakpointData(id).enabled
-                && !d->m_engine->acceptsBreakpoint(id)) {
+    if (d->m_engine->startParameters().startMode == StartInternal) {
+        foreach (const BreakpointModelId &id, debuggerCore()->breakHandler()->allBreakpointIds()) {
+            if (d->m_engine->breakHandler()->breakpointData(id).enabled
+                    && !d->m_engine->acceptsBreakpoint(id)) {
 
-            QString warningMessage =
-                    DebuggerPlugin::tr("Some breakpoints cannot be handled by the debugger "
-                                       "languages currently active, and will be ignored.");
+                QString warningMessage =
+                        DebuggerPlugin::tr("Some breakpoints cannot be handled by the debugger "
+                                           "languages currently active, and will be ignored.");
 
-            debuggerCore()->showMessage(warningMessage, LogWarning);
+                debuggerCore()->showMessage(warningMessage, LogWarning);
 
-            QErrorMessage *msgBox = new QErrorMessage(debuggerCore()->mainWindow());
-            msgBox->setAttribute(Qt::WA_DeleteOnClose);
-            msgBox->showMessage(warningMessage);
-            break;
+                QErrorMessage *msgBox = new QErrorMessage(debuggerCore()->mainWindow());
+                msgBox->setAttribute(Qt::WA_DeleteOnClose);
+                msgBox->showMessage(warningMessage);
+                break;
+            }
         }
     }
 
-- 
GitLab