3 Commits

Author SHA1 Message Date
3f66c4f53f Initial plan 2025-11-22 07:59:21 +00:00
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
2 changed files with 7 additions and 2 deletions

View File

@ -42,7 +42,10 @@ def debug_info_generation(
# Process all fields and create members for the struct # Process all fields and create members for the struct
members = [] 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: try:
# Get appropriate debug type for this field # Get appropriate debug type for this field
field_type = _get_field_debug_type( field_type = _get_field_debug_type(
@ -97,7 +100,9 @@ def _get_field_debug_type(
# Handle function pointer types (CFUNCTYPE) # Handle function pointer types (CFUNCTYPE)
if callable(field.ctype_complex_type): if callable(field.ctype_complex_type):
# Function pointers are represented as void pointers # 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) void_ptr = generator.create_pointer_type(None, 64)
return void_ptr, 64 return void_ptr, 64
elif issubclass(field.ctype_complex_type, ctypes.Array): elif issubclass(field.ctype_complex_type, ctypes.Array):