diff options
author | hjk <[email protected]> | 2012-01-17 16:22:05 +0100 |
---|---|---|
committer | hjk <[email protected]> | 2012-01-17 17:01:02 +0100 |
commit | ad5c0edd335a6b9620e5062435532e632214f58c (patch) | |
tree | 86e26249605f8867104cfdae6b542cf65cb014cc /src/plugins/debugger/debuggerplugin.cpp | |
parent | 36573eda7b85b8659c6ba340db14794fa8726d3b (diff) |
debugger: handle RunToLine and JumpToLine in assembler
... even when not using the context menu.
Task-number: QTCREATORBUG-6811
Change-Id: I1dae875a4c573eba345c6a87cdb0ea24dc50c235
Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggerplugin.cpp')
-rw-r--r-- | src/plugins/debugger/debuggerplugin.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 46da3405b8c..f10fd3c9018 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -554,14 +554,21 @@ static TextEditor::ITextEditor *currentTextEditor() static bool currentTextEditorPosition(ContextData *data) { - if (TextEditor::ITextEditor *textEditor = currentTextEditor()) { - if (const Core::IFile *file = textEditor->file()) { - data->fileName = file->fileName(); - data->lineNumber = textEditor->currentLine(); - return true; - } + TextEditor::ITextEditor *textEditor = currentTextEditor(); + if (!textEditor) + return false; + const Core::IFile *file = textEditor->file(); + QTC_ASSERT(file, return false); + data->fileName = file->fileName(); + if (textEditor->property("DisassemblerView").toBool()) { + int lineNumber = textEditor->currentLine(); + QString line = textEditor->contents() + .section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1); + data->address = DisassemblerLine::addressFromDisassemblyLine(line); + } else { + data->lineNumber = textEditor->currentLine(); } - return false; + return true; } /////////////////////////////////////////////////////////////////////// |