Compare commits

..

3 Commits

Author SHA1 Message Date
a2de15fb1e add c_int to type_deducer.py 2025-11-22 13:36:21 +05:30
081ee5cb4c move requests.py to passing tests 2025-11-22 13:19:55 +05:30
a91c3158ad sort fields in debug info by offset order 2025-11-22 12:35:47 +05:30
3 changed files with 8 additions and 2 deletions

View File

@ -17,6 +17,7 @@ mapping = {
"c_ulong": ir.IntType(64),
"c_longlong": ir.IntType(64),
"c_uint": ir.IntType(32),
"c_int": ir.IntType(32),
# Not so sure about this one
"str": ir.PointerType(ir.IntType(8)),
}

View File

@ -42,7 +42,10 @@ def debug_info_generation(
# Process all fields and create members for the struct
members = []
for field_name, field in struct.fields.items():
sorted_fields = sorted(struct.fields.items(), key=lambda item: item[1].offset)
for field_name, field in sorted_fields:
try:
# Get appropriate debug type for this field
field_type = _get_field_debug_type(
@ -97,7 +100,9 @@ def _get_field_debug_type(
# Handle function pointer types (CFUNCTYPE)
if callable(field.ctype_complex_type):
# Function pointers are represented as void pointers
logger.info(f"Field {field_name} is a function pointer, using void pointer")
logger.warning(
f"Field {field_name} is a function pointer, using void pointer"
)
void_ptr = generator.create_pointer_type(None, 64)
return void_ptr, 64
elif issubclass(field.ctype_complex_type, ctypes.Array):