# This file may be distributed under the terms of the GNU GPLv3 license.
# Usage:
-# objdump -m i386 -M i8086 -M suffix -d out/rom16.o | tools/checkstack.py
+# objdump -m i386 -M i8086 -M suffix -d out/rom16.reloc.o | tools/checkstack.py
import sys
import re
# List of functions we can assume are never called.
-#IGNORE = ['screenc', 'BX_PANIC', '__dprintf']
-IGNORE = ['screenc', 'BX_PANIC']
+#IGNORE = ['panic', '__dprintf', '__send_disk_op']
+IGNORE = ['panic', '__send_disk_op']
# Find out maximum stack usage for a function
def calcmaxstack(funcs, funcaddr):
+ r'):\t.*\t(addr32 )?(?P<insn>.+?)[ ]*((?P<calladdr>' + hex_s
+ r') <(?P<ref>.*)>)?$')
re_usestack = re.compile(
- r'^(push.*)|(sub.* [$](?P<num>0x' + hex_s + r'),%esp)$')
+ r'^(push[f]?[lw])|(sub.* [$](?P<num>0x' + hex_s + r'),%esp)$')
def calc():
# funcs[funcaddr] = [funcname, basicstackusage, maxstackusage