mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-20 03:46:11 +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())) {
|
||||||
|
QString text = t->text;
|
||||||
|
QStringList tokens = text.split('\n');
|
||||||
|
// text might contain multiple lines
|
||||||
|
// so we split them and keep only one
|
||||||
|
// arrow/jump to addr.
|
||||||
|
for (const auto &tok : tokens) {
|
||||||
DisassemblyLine line;
|
DisassemblyLine line;
|
||||||
line.offset = t->offset;
|
line.offset = t->offset;
|
||||||
line.text = ansiEscapeToHtml(t->text);
|
line.text = ansiEscapeToHtml(tok);
|
||||||
line.arrow = t->arrow;
|
line.arrow = t->arrow;
|
||||||
r << line;
|
r << line;
|
||||||
|
// only the first one.
|
||||||
|
t->arrow = RVA_INVALID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user