Commit ad5c0edd authored by hjk's avatar hjk Committed by hjk

debugger: handle RunToLine and JumpToLine in assembler

... even when not using the context menu.

Task-number: QTCREATORBUG-6811
Change-Id: I1dae875a4c573eba345c6a87cdb0ea24dc50c235
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 36573eda
......@@ -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;
}
///////////////////////////////////////////////////////////////////////
......
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