mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
add basic IR gen strategy
This commit is contained in:
15
pythonbpf/vmlinux_parser/ir_gen/debug_info_gen.py
Normal file
15
pythonbpf/vmlinux_parser/ir_gen/debug_info_gen.py
Normal file
@ -0,0 +1,15 @@
|
||||
from pythonbpf.debuginfo import DebugInfoGenerator
|
||||
|
||||
|
||||
def debug_info_generation(struct, llvm_module):
|
||||
generator = DebugInfoGenerator(llvm_module)
|
||||
# this is sample debug info generation
|
||||
# i64type = generator.get_uint64_type()
|
||||
|
||||
struct_type = generator.create_struct_type([], 64 * 4, is_distinct=True)
|
||||
|
||||
global_var = generator.create_global_var_debug_info(
|
||||
struct.name, struct_type, is_local=False
|
||||
)
|
||||
|
||||
return global_var
|
||||
Reference in New Issue
Block a user