From 1be13759e33d66d0f6fe38c005fea6943f33891c Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Thu, 3 Feb 2011 13:45:03 +0100
Subject: [PATCH] debugger: fix breakpoint handling in main editor context menu

---
 src/plugins/debugger/debuggerplugin.cpp | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 1302e743dd..b336de8ab2 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -1799,13 +1799,10 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor,
     if (!isDebuggable(editor))
         return;
 
-    BreakpointId id = BreakpointId();
-    QString fileName;
-    quint64 address = 0;
-
     ContextData args;
     args.lineNumber = lineNumber;
 
+    BreakpointId id = BreakpointId();
     if (editor->property("DisassemblerView").toBool()) {
         args.fileName = editor->file()->fileName();
         QString line = editor->contents()
@@ -1818,7 +1815,8 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor,
         id = breakHandler()->findSimilarBreakpoint(needle);
     } else {
         args.fileName = editor->file()->fileName();
-        id = breakHandler()->findBreakpointByFileAndLine(fileName, lineNumber);
+        id = breakHandler()
+            ->findBreakpointByFileAndLine(args.fileName, lineNumber);
     }
 
     if (id) {
@@ -1852,8 +1850,8 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor,
         menu->addAction(act);
     } else {
         // Handle non-existing breakpoint.
-        const QString text = address ?
-                    tr("Set Breakpoint at 0x%1").arg(address, 0, 16) :
+        const QString text = args.address ?
+                    tr("Set Breakpoint at 0x%1").arg(args.address, 0, 16) :
                     tr("Set Breakpoint at line %1").arg(lineNumber);
         QAction *act = new QAction(text, menu);
         act->setData(QVariant::fromValue(args));
-- 
GitLab