diff --git a/App/lib/core/Gen/Expr/ExprGenAttr.vp b/App/lib/core/Gen/Expr/ExprGenAttr.vp index 3484f0d..ab5016f 100644 --- a/App/lib/core/Gen/Expr/ExprGenAttr.vp +++ b/App/lib/core/Gen/Expr/ExprGenAttr.vp @@ -933,27 +933,29 @@ novirtual class ExprGenAttr(ExprGenBase.ExprGenBase): # stub 空类 FieldCount=0,如 LARGE_INTEGER)→ 走下方真实报错 # (lookup_field_by_class 已对空 stub 返回 None 而非 fatal)。 if trans is not None: - # [DBG-ATTR] 一次性取证(用完删除) - if string.strcmp(at.attr, "FuncGenBase") == 0: - _db_pt: str = "" - if obj_ptr is not None and obj_ptr.Ty is not None: - _db_b: str = pool.alloc(256) - if _db_b is not None: - _db_b[0] = '\0' - llvmlite.TypePrint(_db_b, 256, obj_ptr.Ty, pool) - _db_pt = _db_b - stdio.printf("[DBG-ATTR] FuncGenBase obj_ptr.Ty=%s\n", _db_pt) - _db_bc: str = "" - _db_bcv: str = self._resolve_attr_field_class(pool, trans, at.value, 1) - if _db_bcv is not None: - _db_bc = _db_bcv - stdio.printf("[DBG-ATTR] FuncGenBase base_class=%s\n", _db_bc) - _db_fb: int = -1 - if _db_bcv is not None: - _db_fe: GenTypes.FieldEntry* = self.Gen.StructGen.lookup_field_by_class(_db_bcv, "FuncGenBase", trans.ModuleSha1, at, trans._from_imports) - if _db_fe is not None: - _db_fb = _db_fe.Index - stdio.printf("[DBG-ATTR] FuncGenBase by_class_index=%d\n", _db_fb) + # [DBG-ATTR] 一次性取证(用完删除):任何属性访问失败都打印 + _db_pt: str = "" + if obj_ptr is not None and obj_ptr.Ty is not None: + _db_b: str = pool.alloc(256) + if _db_b is not None: + _db_b[0] = '\0' + llvmlite.TypePrint(_db_b, 256, obj_ptr.Ty, pool) + _db_pt = _db_b + _db_sn: str = "" + _db_snm: str = llvmlite.get_struct_name(struct_ty) + if _db_snm is not None: + _db_sn = _db_snm + _db_sc: int = -1 + _db_se: GenTypes.StructEntry* = self.Gen.StructGen.find_struct_by_type(struct_ty) + if _db_se is not None: + _db_sc = _db_se.FieldCount + stdio.printf("[DBG-ATTR] attr=%s obj_ptr.Ty=%s struct=%s fcount=%d\n", + at.attr, _db_pt, _db_sn, _db_sc) + _db_bc: str = "" + _db_bcv: str = self._resolve_attr_field_class(pool, trans, at.value, 1) + if _db_bcv is not None: + _db_bc = _db_bcv + stdio.printf("[DBG-ATTR] base_class=%s\n", _db_bc) diag_annot: str = None diag_var_nm: str = None if at.value is not None and at.value.kind() == ast.ASTKind.Name: