Skip to content

Commit 12bca3c

Browse files
fix: debug info addition for specific hashmap
1 parent d7a5a06 commit 12bca3c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pythonbpf/maps_pass.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def create_map_debug_info(module, map_global, map_name, map_params):
9090
# Create array type for map type field (array of 1 unsigned int)
9191
array_subrange = module.add_debug_info("DISubrange", {"count": 1})
9292
array_type = module.add_debug_info("DICompositeType", {
93-
"tag": 17, # "DW_TAG_array_type"
93+
"tag": 1, # "DW_TAG_array_type"
9494
"baseType": uint_type,
9595
"size": 32,
9696
"elements": [array_subrange]
@@ -122,6 +122,7 @@ def create_map_debug_info(module, map_global, map_name, map_params):
122122
})
123123

124124
# Create struct members
125+
# scope field does not appear for some reason
125126
type_member = module.add_debug_info("DIDerivedType", {
126127
"tag": 13, # "DW_TAG_member"
127128
"name": "type",
@@ -161,12 +162,10 @@ def create_map_debug_info(module, map_global, map_name, map_params):
161162
# Create the struct type
162163
struct_type = module.add_debug_info("DICompositeType", {
163164
"tag": 19, # DW_TAG_structure_type
164-
"name": "anon", # Anonymous struct
165165
"file": file_metadata,
166166
"size": 256, # 4 * 64-bit pointers
167-
"align": 64,
168167
"elements": [type_member, max_entries_member, key_member, value_member]
169-
})
168+
}, is_distinct=True)
170169

171170
# Create global variable debug info
172171
global_var = module.add_debug_info("DIGlobalVariable", {
@@ -176,7 +175,7 @@ def create_map_debug_info(module, map_global, map_name, map_params):
176175
"type": struct_type,
177176
"isLocal": False,
178177
"isDefinition": True
179-
})
178+
}, is_distinct=True)
180179

181180
# Create global variable expression
182181
global_var_expr = module.add_debug_info("DIGlobalVariableExpression", {

0 commit comments

Comments
 (0)