debugger: fix off-by-one error in mixed disassembler output

This commit is contained in:
hjk
2010-02-04 15:01:42 +01:00
parent f27a8d88a6
commit 2ce1603ccf

View File

@@ -3634,8 +3634,8 @@ QString GdbEngine::parseDisassembler(const GdbMi &lines)
fileLoaded = true;
}
int line = child.findChild("line").data().toInt();
if (line >= 0 && line < fileContents.size())
ba += " " + fileContents.at(line) + '\n';
if (line >= 1 && line <= fileContents.size())
ba += " " + fileContents.at(line - 1) + '\n';
GdbMi insn = child.findChild("line_asm_insn");
foreach (const GdbMi &line, insn.children())
ba += parseLine(line);