summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2020-11-21 18:03:20 -0500
committerBrian Potchik <brian@vector35.com>2020-11-21 18:03:20 -0500
commita805c3c0cc4cb28fba7454ceabf78c8641930337 (patch)
tree55ceafdbc8ceee88575ad974ae8e93cc263cb8f6
parentdf48a9ee65c4fa3b60f3bfebb36aa03d8dd40f2d (diff)
Add IL instruction index navigation support to flowgraph view types.
-rw-r--r--ui/disassemblyview.h1
-rw-r--r--ui/flowgraphwidget.h8
-rw-r--r--ui/linearview.h1
-rw-r--r--ui/viewframe.h1
4 files changed, 9 insertions, 2 deletions
diff --git a/ui/disassemblyview.h b/ui/disassemblyview.h
index ed7c5f30..8066c056 100644
--- a/ui/disassemblyview.h
+++ b/ui/disassemblyview.h
@@ -40,6 +40,7 @@ public:
virtual bool navigate(uint64_t pos) override;
virtual bool navigateToFunction(FunctionRef func, uint64_t pos) override;
+ virtual bool navigateToFunctionIndex(FunctionRef func, size_t index) override;
virtual HistoryEntry* getHistoryEntry() override;
virtual void navigateToHistoryEntry(HistoryEntry* entry) override;
diff --git a/ui/flowgraphwidget.h b/ui/flowgraphwidget.h
index 65254971..2c05144d 100644
--- a/ui/flowgraphwidget.h
+++ b/ui/flowgraphwidget.h
@@ -113,6 +113,7 @@ class BINARYNINJAUIAPI FlowGraphWidget: public QAbstractScrollArea, public View,
uint64_t m_addrAfterLayout;
bool m_pendingXrefNavigation, m_xrefNavigation;
uint64_t m_xrefTarget;
+ size_t m_indexAfterlayout;
InstructionEdit* m_instrEdit;
@@ -163,8 +164,8 @@ protected:
void navigateToAddress(uint64_t addr);
void navigateToGotoLabel(uint64_t label);
- void setGraphInternal(FlowGraphRef graph, FlowGraphHistoryEntry* entry, bool useAddr, uint64_t addr, bool notify,
- bool recenterWithPreviousGraph);
+ void setGraphInternal(FlowGraphRef graph, FlowGraphHistoryEntry* entry, bool useAddr, uint64_t addr,
+ bool notify, bool recenterWithPreviousGraph, size_t index = BN_INVALID_EXPR);
void up(bool selecting, size_t count = 1);
void down(bool selecting, size_t count = 1);
@@ -198,6 +199,7 @@ public:
void setGraph(FlowGraphRef graph);
void setGraph(FlowGraphRef graph, uint64_t addr);
+ void setGraphAtIndex(FlowGraphRef graph, size_t index);
void setGraph(FlowGraphRef graph, FlowGraphHistoryEntry* entry);
void setRelatedGraph(FlowGraphRef graph);
void setRelatedGraph(FlowGraphRef graph, uint64_t addr);
@@ -211,6 +213,7 @@ public:
virtual void setSelectionOffsets(BNAddressRange range) override;
virtual bool navigate(uint64_t pos) override;
virtual bool navigateToFunction(FunctionRef func, uint64_t pos) override;
+ virtual bool navigateToFunctionIndex(FunctionRef func, size_t index) override;
bool navigateWithHistoryEntry(uint64_t addr, FlowGraphHistoryEntry* entry);
bool navigateWithHistoryEntry(FunctionRef func, uint64_t addr, FlowGraphHistoryEntry* entry);
void setNavigationTarget(View* target) { m_navigationTarget = target; }
@@ -258,6 +261,7 @@ public:
void paintEdge(QPainter& p, const FlowGraphNodeRef& node, const BinaryNinja::FlowGraphEdge& edge);
void showAddress(uint64_t addr, bool select = false);
+ void showIndex(size_t index);
void showTopNode();
void showNode(FlowGraphNodeRef node);
void showLineInNode(FlowGraphNodeRef node, size_t lineIndex);
diff --git a/ui/linearview.h b/ui/linearview.h
index 33d8a3f1..3bd446be 100644
--- a/ui/linearview.h
+++ b/ui/linearview.h
@@ -294,6 +294,7 @@ public:
virtual FunctionRef getCurrentFunction() override;
virtual BasicBlockRef getCurrentBasicBlock() override;
virtual ArchitectureRef getCurrentArchitecture() override;
+ virtual size_t getCurrentILInstructionIndex() override;
virtual bool navigateToFunction(FunctionRef func, uint64_t pos) override;
virtual bool navigate(uint64_t pos) override;
diff --git a/ui/viewframe.h b/ui/viewframe.h
index e0582a59..b4d3413e 100644
--- a/ui/viewframe.h
+++ b/ui/viewframe.h
@@ -128,6 +128,7 @@ public:
virtual BNFunctionGraphType getILViewType() { return NormalFunctionGraph; }
virtual void setILViewType(BNFunctionGraphType ilViewType) { }
virtual size_t getCurrentILInstructionIndex() { return BN_INVALID_EXPR; }
+ virtual bool navigateToFunctionIndex(FunctionRef func, size_t index) { return false; }
virtual QFont getFont() = 0;
DisassemblySettingsRef getDisassemblySettings();