Fixed some bugs and tried to maintain the bootstrap
This commit is contained in:
@@ -522,16 +522,8 @@ def lookup_field_by_class(class_name: str,
|
||||
entry = find_struct(class_name)
|
||||
if entry is None:
|
||||
# 诊断:遍历打印所有已注册结构体名,确认目标类是否在注册表中
|
||||
stdio.printf("[LFBC-DIAG] FAIL class=%s field=%s sha1=%s count=%d\n",
|
||||
class_name, field_name,
|
||||
sha1 if sha1 is not None else "(null)", _struct_count)
|
||||
for diag_i in range(_struct_count):
|
||||
diag_entry: StructEntry | t.CPtr = _get_struct_entry(diag_i)
|
||||
if diag_entry is not None and diag_entry.Name is not None:
|
||||
stdio.printf("[LFBC-DIAG] [%d] %s sha1=%s fc=%d\n",
|
||||
diag_i, diag_entry.Name,
|
||||
diag_entry.ModuleSha1 if diag_entry.ModuleSha1 is not None else "(null)",
|
||||
diag_entry.FieldCount)
|
||||
return None
|
||||
for fi in range(entry.FieldCount):
|
||||
fe: FieldEntry | t.CPtr = _get_field_entry(entry, fi)
|
||||
@@ -539,8 +531,6 @@ def lookup_field_by_class(class_name: str,
|
||||
if string.strcmp(fe.Name, field_name) == 0:
|
||||
return fe
|
||||
# 诊断:找到结构体但字段未找到
|
||||
stdio.printf("[LFBC-DIAG] NOFIELD class=%s field=%s sname=%s fc=%d\n",
|
||||
class_name, field_name, entry.Name, entry.FieldCount)
|
||||
return None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user