mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-24 05:45:27 +00:00
Fix arrow line calculation when disasm line is has multiple newlines. (#3217)
This commit is contained in:
parent
3bcafe9625
commit
3e74b9ad67
@ -4143,11 +4143,20 @@ QList<DisassemblyLine> CutterCore::disassembleLines(RVA offset, int lines)
|
|||||||
|
|
||||||
QList<DisassemblyLine> r;
|
QList<DisassemblyLine> r;
|
||||||
for (const auto &t : CutterPVector<RzAnalysisDisasmText>(vec.get())) {
|
for (const auto &t : CutterPVector<RzAnalysisDisasmText>(vec.get())) {
|
||||||
DisassemblyLine line;
|
QString text = t->text;
|
||||||
line.offset = t->offset;
|
QStringList tokens = text.split('\n');
|
||||||
line.text = ansiEscapeToHtml(t->text);
|
// text might contain multiple lines
|
||||||
line.arrow = t->arrow;
|
// so we split them and keep only one
|
||||||
r << line;
|
// arrow/jump to addr.
|
||||||
|
for (const auto &tok : tokens) {
|
||||||
|
DisassemblyLine line;
|
||||||
|
line.offset = t->offset;
|
||||||
|
line.text = ansiEscapeToHtml(tok);
|
||||||
|
line.arrow = t->arrow;
|
||||||
|
r << line;
|
||||||
|
// only the first one.
|
||||||
|
t->arrow = RVA_INVALID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user