Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion stack-usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ def addCallee(self, callee):
cgraph.getFunction(text[3]).setStackSize(int(cols[1]))

with open(args.callgraph, "r") as f:
name = None
for line in f:
if line.find("@") != -1 and not line.startswith(" Aux: @"):
name = line[0:line.find("/")]
if line.startswith(" Calls:") and len(line) > 10:
if line.startswith(" Calls:") and len(line) > 10 and name is not None:
for callee in line[9:].split(" "):
if callee.find("/") != -1:
cgraph.addCall(name, callee[:callee.find("/")])
Expand Down