Skip to content

Commit 17435e0

Browse files
committed
ui: support for il xref navigation
1 parent b3b3fcd commit 17435e0

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

ui/xreflist.h

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ class XrefItem
5555
TypeXrefType
5656
};
5757

58+
enum XrefQueryKind
59+
{
60+
AddressXrefQuery,
61+
TypeXrefQuery,
62+
TypeFieldXrefQuery,
63+
LocalVarXrefQuery
64+
};
65+
5866
protected:
5967
FunctionRef m_func;
6068
ArchitectureRef m_arch;
@@ -65,6 +73,7 @@ class XrefItem
6573
BNFunctionGraphType m_ilType;
6674
size_t m_instrId;
6775
XrefType m_type;
76+
XrefQueryKind m_queryKind;
6877
XrefDirection m_direction;
6978
mutable std::vector<BinaryNinja::InstructionTextToken> m_cachedTokens;
7079
mutable XrefHeader* m_parentItem;
@@ -74,11 +83,13 @@ class XrefItem
7483
explicit XrefItem();
7584
explicit XrefItem(XrefHeader* parent, XrefType type, FunctionRef func);
7685
// The four constructors are used for code/data/type/variable references, respectively
77-
explicit XrefItem(BinaryNinja::ReferenceSource ref, XrefType type, XrefDirection direction);
78-
explicit XrefItem(uint64_t addr, XrefType type, XrefDirection direction);
79-
explicit XrefItem(BinaryNinja::TypeReferenceSource ref, XrefType type, XrefDirection direction);
80-
explicit XrefItem(
81-
BinaryNinja::Variable var, BinaryNinja::ILReferenceSource ref, XrefType type, XrefDirection direction);
86+
explicit XrefItem(BinaryNinja::ReferenceSource ref, XrefType type, XrefDirection direction,
87+
XrefQueryKind kind);
88+
explicit XrefItem(uint64_t addr, XrefType type, XrefDirection direction, XrefQueryKind kind);
89+
explicit XrefItem(BinaryNinja::TypeReferenceSource ref, XrefType type, XrefDirection direction,
90+
XrefQueryKind kind);
91+
explicit XrefItem(BinaryNinja::Variable var, BinaryNinja::ILReferenceSource ref, XrefType type,
92+
XrefDirection direction, XrefQueryKind kind);
8293
XrefItem(const XrefItem& ref);
8394
virtual ~XrefItem();
8495

@@ -92,6 +103,7 @@ class XrefItem
92103
BNFunctionGraphType ilType() const { return m_ilType; }
93104
size_t instrId() const { return m_instrId; }
94105
XrefType type() const { return m_type; }
106+
XrefQueryKind kind() const { return m_queryKind; }
95107
int size() const { return m_size; }
96108
void setSize(int size) const { m_size = size; }
97109
void setParent(XrefHeader* parent) const;

0 commit comments

Comments
 (0)