diff options
author | hjk <[email protected]> | 2013-10-17 17:36:01 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2013-10-17 17:52:23 +0200 |
commit | b55edaefb321caaf9e64b346bedb5419d679ee2f (patch) | |
tree | a7a352fee15e0185b6a8e9cbd4dcd4c763fe29bc /src/plugins/debugger/debuggerplugin.cpp | |
parent | 9aa52a2c7ea6ab16febc6d9d01b22f9c082798e5 (diff) |
Debugger: Fix setting of breakpoints in disassembler view
Task-number: QTCREATORBUG-10410
Change-Id: I76f6b430c277b6b7750c1c0b0de71e689dfea7de
Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggerplugin.cpp')
-rw-r--r-- | src/plugins/debugger/debuggerplugin.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index b2e3122cce8..a01bdc9b636 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -682,7 +682,7 @@ static bool currentTextEditorPosition(ContextData *data) const IDocument *document = textEditor->document(); QTC_ASSERT(document, return false); data->fileName = document->filePath(); - if (textEditor->property("DisassemblerView").toBool()) { + if (document->property(Constants::OPENED_WITH_DISASSEMBLY).toBool()) { int lineNumber = textEditor->currentLine(); QString line = textEditor->textDocument()->contents() .section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1); @@ -1840,10 +1840,10 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor, bool contextUsable = true; BreakpointModelId id = BreakpointModelId(); - const QString fileName = editor->document()->filePath(); - if (editor->property("DisassemblerView").toBool()) { - args.fileName = fileName; - QString line = editor->textDocument()->contents() + ITextEditorDocument *document = editor->textDocument(); + args.fileName = document->filePath(); + if (document->property(Constants::OPENED_WITH_DISASSEMBLY).toBool()) { + QString line = document->contents() .section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1); BreakpointResponse needle; needle.type = BreakpointByAddress; @@ -1853,7 +1853,6 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor, id = breakHandler()->findSimilarBreakpoint(needle); contextUsable = args.address != 0; } else { - args.fileName = editor->document()->filePath(); id = breakHandler() ->findBreakpointByFileAndLine(args.fileName, lineNumber); if (!id) @@ -1937,7 +1936,7 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor, if (currentEngine()->state() == InferiorStopOk && currentEngine()->hasCapability(DisassemblerCapability)) { StackFrame frame; - frame.function = cppFunctionAt(fileName, lineNumber); + frame.function = cppFunctionAt(args.fileName, lineNumber); frame.line = 42; // trick gdb into mixed mode. if (!frame.function.isEmpty()) { const QString text = tr("Disassemble Function \"%1\"") @@ -1956,7 +1955,7 @@ void DebuggerPluginPrivate::toggleBreakpoint() ITextEditor *textEditor = currentTextEditor(); QTC_ASSERT(textEditor, return); const int lineNumber = textEditor->currentLine(); - if (textEditor->property("DisassemblerView").toBool()) { + if (textEditor->property(Constants::OPENED_WITH_DISASSEMBLY).toBool()) { QString line = textEditor->textDocument()->contents() .section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1); quint64 address = DisassemblerLine::addressFromDisassemblyLine(line); |