debug(gen): 一次性插桩打印 Generator.FuncGenBase 字段查找上下文(用完删除)

AsyncGenMixin.vp:58 `self.Gen.FuncGenBase` 报「属性访问失败」,需确认
lookup_field 收到的 struct_ty 是谁、结构体表里 Generator 条目的 FieldCount/sha1,
以判断是字段缺失、Ty 身份不一致还是按到了空/错误条目。仅打印,不改行为。
This commit is contained in:
TermiNexus committed 2026-10-02 02:10:58 +08:00
1 parent f865986675
commit 1d1efc6288
1 file changed
+20
+20
View File
@@ -1304,6 +1304,26 @@ novirtual class StructGenMixin:
if struct_ty is None or field_name is None or self.StructTable is None:
return None
# [DBG-GEN] 一次性诊断(定位 Generator.FuncGenBase 字段查找失败,用完删除)
if string.strcmp(field_name, "FuncGenBase") == 0:
_dg_ty: str = self._extract_struct_name(struct_ty)
_dg_ty_t: str = "<non-struct>"
if _dg_ty is not None:
_dg_ty_t = _dg_ty
stdio.printf("[DBG-GEN] lookup 'FuncGenBase' struct_ty=%s\n", _dg_ty_t)
_dg_i: int = 0
while _dg_i < self.StructCount:
_dg_e: GenTypes.StructEntry* = self._get_struct_entry(_dg_i)
if _dg_e is not None and _dg_e.Name is not None:
if string.strstr(_dg_e.Name, "Generator") is not None:
_dg_sh: str = _dg_e.ModuleSha1
_dg_sh_t: str = "<null>"
if _dg_sh is not None:
_dg_sh_t = _dg_sh
stdio.printf("[DBG-GEN] tbl[%d] name=%s fcount=%d sha1=%s\n",
_dg_i, _dg_e.Name, _dg_e.FieldCount, _dg_sh_t)
_dg_i += 1
# ============================================================
# 两遍查找策略(跨模块同名类冲突的根本修复):
#