File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,19 @@ def _allocate_for_call(
118118 local_sym_tab [var_name ] = LocalSymbol (var , struct_info .ir_type , call_type )
119119 logger .info (f"Pre-allocated { var_name } for struct { call_type } " )
120120
121+ elif VmlinuxHandlerRegistry .is_vmlinux_struct (call_type ):
122+ # When calling struct_name(pointer), we're doing a cast, not construction
123+ # So we allocate as a pointer (i64) not as the actual struct
124+ ir_type = ir .IntType (64 ) # Pointer type
125+ var = builder .alloca (ir_type , name = var_name )
126+ var .align = 8
127+ local_sym_tab [var_name ] = LocalSymbol (
128+ var , ir_type , VmlinuxHandlerRegistry .get_struct_type (call_type )
129+ )
130+ logger .info (
131+ f"Pre-allocated { var_name } for vmlinux struct pointer cast to { call_type } "
132+ )
133+
121134 else :
122135 logger .warning (f"Unknown call type for allocation: { call_type } " )
123136
Original file line number Diff line number Diff line change 1616 "c_long" : ir .IntType (64 ),
1717 "c_ulong" : ir .IntType (64 ),
1818 "c_longlong" : ir .IntType (64 ),
19- "c_uint" : ir .IntType (32 ),
20- "c_int" : ir .IntType (32 ),
2119 # Not so sure about this one
2220 "str" : ir .PointerType (ir .IntType (8 )),
2321}
Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ def _get_field_debug_type(
126126
127127 # If not found, create a forward declaration
128128 # This will be completed when the actual struct is processed
129- logger .warning (
129+ logger .info (
130130 f"Forward declaration created for { struct_name } in { parent_struct .name } "
131131 )
132132 forward_type = generator .create_struct_type ([], 0 , is_distinct = True )
You can’t perform that action at this time.
0 commit comments