fix broken IR generation logic for globals

This commit is contained in:
2025-10-03 22:55:40 +05:30
parent c3a512d5cf
commit ab1c4223d5
2 changed files with 65 additions and 28 deletions

View File

@ -1,17 +1,28 @@
import logging
from pythonbpf import compile, bpf, section, bpfglobal, compile_to_ir
from ctypes import c_void_p, c_int64
from ctypes import c_void_p, c_int64, c_int32
@bpf
@bpfglobal
def somevalue() -> c_int64:
def somevalue() -> c_int32:
return c_int32(0)
@bpf
@bpfglobal
def somevalue2() -> c_int64:
return c_int64(0)
@bpf
@section("sometag1")
@bpfglobal
def somevalue1() -> c_int32:
return c_int32(0)
@bpf
@section("tracepoint/syscalls/sys_enter_execve")
def sometag(ctx: c_void_p) -> c_int64:
return c_int64(0)
print("test")
return c_int64(1)
@bpf
@bpfglobal