mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2026-03-24 22:21:29 +00:00
add globals todo
This commit is contained in:
@ -62,7 +62,9 @@ def compile_to_ir(filename: str, output: str):
|
||||
"language": DW_LANG_C11,
|
||||
"file": module._file_metadata, # type: ignore
|
||||
"producer": f"PythonBPF {version}",
|
||||
"isOptimized": True,
|
||||
"isOptimized": True, #TODO: This is probably not true
|
||||
#TODO: add a global field here that keeps track of all the globals. Works without it, but I think it might
|
||||
# be required for kprobes.
|
||||
"runtimeVersion": 0,
|
||||
"emissionKind": 1,
|
||||
"splitDebugInlining": False,
|
||||
@ -80,12 +82,12 @@ def compile_to_ir(filename: str, output: str):
|
||||
frame_pointer = module.add_metadata([DwarfBehaviorEnum.OVERRIDE_USE_LARGEST,
|
||||
"frame-pointer",
|
||||
ir.Constant(ir.IntType(32), 2)])
|
||||
# Add Debug Info Version (3 = DWARF v3, which LLVM expects)
|
||||
# Add Debug Info Version 3
|
||||
debug_info_version = module.add_metadata([DwarfBehaviorEnum.WARNING_IF_MISMATCH,
|
||||
"Debug Info Version",
|
||||
ir.Constant(ir.IntType(32), 3)])
|
||||
|
||||
# Add explicit DWARF version (4 is common, works with LLVM BPF backend)
|
||||
# Add explicit DWARF version 5
|
||||
dwarf_version = module.add_metadata([DwarfBehaviorEnum.OVERRIDE_USE_LARGEST,
|
||||
"Dwarf Version",
|
||||
ir.Constant(ir.IntType(32), 5)])
|
||||
|
||||
Reference in New Issue
Block a user