mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-19 02:48:49 +00:00
Seek to first call if multiple references (#3240)
This commit is contained in:
parent
2066a4b3e1
commit
359bd91a21
@ -65,7 +65,6 @@ void CutterSeekable::seekToReference(RVA offset)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RVA target;
|
|
||||||
QList<XrefDescription> refs = Core()->getXRefs(offset, false, false);
|
QList<XrefDescription> refs = Core()->getXRefs(offset, false, false);
|
||||||
|
|
||||||
if (refs.length()) {
|
if (refs.length()) {
|
||||||
@ -73,10 +72,19 @@ void CutterSeekable::seekToReference(RVA offset)
|
|||||||
qWarning() << tr("More than one (%1) references here. Weird behaviour expected.")
|
qWarning() << tr("More than one (%1) references here. Weird behaviour expected.")
|
||||||
.arg(refs.length());
|
.arg(refs.length());
|
||||||
}
|
}
|
||||||
|
// Try first call
|
||||||
target = refs.at(0).to;
|
for (auto &ref : refs) {
|
||||||
if (target != RVA_INVALID) {
|
if (ref.to != RVA_INVALID && ref.type == "CALL") {
|
||||||
seek(target);
|
seek(ref.to);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Fallback to first valid, if any
|
||||||
|
for (auto &ref : refs) {
|
||||||
|
if (ref.to != RVA_INVALID) {
|
||||||
|
seek(ref.to);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user