Commit 1be13759 authored by hjk's avatar hjk
Browse files

debugger: fix breakpoint handling in main editor context menu

parent 5f368a0d
...@@ -1799,13 +1799,10 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor, ...@@ -1799,13 +1799,10 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor,
if (!isDebuggable(editor)) if (!isDebuggable(editor))
return; return;
BreakpointId id = BreakpointId();
QString fileName;
quint64 address = 0;
ContextData args; ContextData args;
args.lineNumber = lineNumber; args.lineNumber = lineNumber;
BreakpointId id = BreakpointId();
if (editor->property("DisassemblerView").toBool()) { if (editor->property("DisassemblerView").toBool()) {
args.fileName = editor->file()->fileName(); args.fileName = editor->file()->fileName();
QString line = editor->contents() QString line = editor->contents()
...@@ -1818,7 +1815,8 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor, ...@@ -1818,7 +1815,8 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor,
id = breakHandler()->findSimilarBreakpoint(needle); id = breakHandler()->findSimilarBreakpoint(needle);
} else { } else {
args.fileName = editor->file()->fileName(); args.fileName = editor->file()->fileName();
id = breakHandler()->findBreakpointByFileAndLine(fileName, lineNumber); id = breakHandler()
->findBreakpointByFileAndLine(args.fileName, lineNumber);
} }
if (id) { if (id) {
...@@ -1852,8 +1850,8 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor, ...@@ -1852,8 +1850,8 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor,
menu->addAction(act); menu->addAction(act);
} else { } else {
// Handle non-existing breakpoint. // Handle non-existing breakpoint.
const QString text = address ? const QString text = args.address ?
tr("Set Breakpoint at 0x%1").arg(address, 0, 16) : tr("Set Breakpoint at 0x%1").arg(args.address, 0, 16) :
tr("Set Breakpoint at line %1").arg(lineNumber); tr("Set Breakpoint at line %1").arg(lineNumber);
QAction *act = new QAction(text, menu); QAction *act = new QAction(text, menu);
act->setData(QVariant::fromValue(args)); act->setData(QVariant::fromValue(args));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment