Commit 6301a1ef authored by Ben Gamari's avatar Ben Gamari 🐢

gdb/find_refs: Handle STACKs

parent 74cf89b0
......@@ -168,6 +168,13 @@ def find_containing_closure(inferior: gdb.Inferior,
return None
elif i <= nptrs + 5: # A bit of fudge for the headers
return start
elif int(info['type']) == closure.ClosureType.STACK:
stack = gdb.parse_and_eval('(StgStack *) %d' % start.addr())
size = int(stack['stack_size'])
if ptr.addr() < start.addr() + size:
return start
print('suspicious info table: too far (field=%s, info@%s=%s, nptrs=%d, i=%d)' % (ptr, start, sym, nptrs, i))
return None
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment