diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-01-26 12:53:37 -0700 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-02-09 23:42:11 -0700 |
commit | 9cd5486484653dd8cc42b43bcde45379982c3177 (patch) | |
tree | 7705acce61527697f7075c326d219a006542de91 /build-aux | |
parent | 55e0167e2ffa3e26ea99ceed30704e21da3d25c8 (diff) |
Add libobj, a replacement for libmisc/vcall.h that internally is more like Go
Diffstat (limited to 'build-aux')
-rwxr-xr-x | build-aux/stack.c.gen | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/build-aux/stack.c.gen b/build-aux/stack.c.gen index 2a23565..3ef5628 100755 --- a/build-aux/stack.c.gen +++ b/build-aux/stack.c.gen @@ -353,7 +353,7 @@ def main( # The sbc-harness codebase ####################################### - vcalls: dict[str, set[str]] = {} + objcalls: dict[str, set[str]] = {} re_vtable_start = re.compile(r"_vtable\s*=\s*\{") re_vtable_entry = re.compile(r"^\s+\.(?P<meth>\S+)\s*=\s*(?P<impl>\S+),.*") for fname in c_fnames: @@ -367,9 +367,9 @@ def main( impl = m.group("impl") if impl == "NULL": continue - if m.group("meth") not in vcalls: - vcalls[meth] = set() - vcalls[meth].add(impl) + if m.group("meth") not in objcalls: + objcalls[meth] = set() + objcalls[meth].add(impl) if "}" in line: in_vtable = False elif re_vtable_start.search(line): @@ -401,14 +401,16 @@ def main( typ = m.group("typ") lib9p_msgs.add(typ) - re_call_vcall = re.compile(r"VCALL\((?P<obj>[^,]+), (?P<meth>[^,)]+)[,)].*") + re_call_objcall = re.compile( + r"(?:VCALL|LO_CALL)\((?P<obj>[^,]+), (?P<meth>[^,)]+)[,)].*" + ) def sbc_indirect_callees(loc: str, line: str) -> list[str] | None: if "/3rd-party/" in loc: return None - if m := re_call_vcall.fullmatch(line): - if m.group("meth") in vcalls: - return sorted(vcalls[m.group("meth")]) + if m := re_call_objcall.fullmatch(line): + if m.group("meth") in objcalls: + return sorted(objcalls[m.group("meth")]) return [f"__indirect_call:{m.group('obj')}->vtable->{m.group('meth')}"] if "trigger->cb(trigger->cb_arg)" in line: return [ |