debug(attr): [DBG-ATTR] 泛化到任意属性访问失败,打印基座/结构体/字段数(用完删除)
Generator.FuncGenBase 已由前向声明修复;新报错 ve_i.Spec.PtrLevel 属同类症状 (某字段指针的 pointee 不是可查字段的结构体)。去掉 attr=="FuncGenBase" 守卫, 任何属性访问失败都打印 obj_ptr.Ty / struct 名 / 条目 FieldCount / base_class。 仅打印,不改行为。
This commit is contained in:
1 parent
87e2356eea
commit
4958fd2c14
1 file changed
+23
-21
@@ -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 = "<null>"
|
||||
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 = "<null>"
|
||||
_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 = "<null>"
|
||||
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 = "<non-struct>"
|
||||
_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 = "<null>"
|
||||
_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:
|
||||
|
||||
Reference in new issue
Block a user