summaryrefslogtreecommitdiff
path: root/functiongraphblock.cpp
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2015-03-04 01:47:13 -0500
committerRusty Wagner <rusty@vector35.com>2015-03-04 01:47:13 -0500
commit5d0f774334c1bea3935001bf665d614c39a60d0f (patch)
tree2feb0d74288139da69709b4b64c957a6e6247a40 /functiongraphblock.cpp
parentc0fdb4320c771fec51e7675a2602ced3ca613500 (diff)
Add architecture to graph edges, and add edge routing data field for layout
Diffstat (limited to 'functiongraphblock.cpp')
-rw-r--r--functiongraphblock.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/functiongraphblock.cpp b/functiongraphblock.cpp
index 8afdef60..3914cc18 100644
--- a/functiongraphblock.cpp
+++ b/functiongraphblock.cpp
@@ -65,14 +65,22 @@ vector<FunctionGraphTextLine> FunctionGraphBlock::GetLines() const
}
-vector<BNBasicBlockEdge> FunctionGraphBlock::GetOutgoingEdges() const
+vector<FunctionGraphEdge> FunctionGraphBlock::GetOutgoingEdges() const
{
size_t count;
- BNBasicBlockEdge* edges = BNGetFunctionGraphBlockOutgoingEdges(m_block, &count);
+ BNFunctionGraphEdge* edges = BNGetFunctionGraphBlockOutgoingEdges(m_block, &count);
- vector<BNBasicBlockEdge> result;
- result.insert(result.begin(), &edges[0], &edges[count]);
+ vector<FunctionGraphEdge> result;
+ for (size_t i = 0; i < count; i++)
+ {
+ FunctionGraphEdge edge;
+ edge.type = edges[i].type;
+ edge.target = edges[i].target;
+ edge.arch = edges[i].arch ? new CoreArchitecture(edges[i].arch) : nullptr;
+ edge.points.insert(edge.points.begin(), &edges[i].points[0], &edges[i].points[edges[i].pointCount]);
+ result.push_back(edge);
+ }
- BNFreeFunctionGraphBlockOutgoingEdgeList(edges);
+ BNFreeFunctionGraphBlockOutgoingEdgeList(edges, count);
return result;
}