add debug info storage on assignment_info.py dataclass

This commit is contained in:
2025-10-26 15:46:03 +05:30
parent 7bf6f9c48c
commit 8bd210cede
6 changed files with 34 additions and 3 deletions

View File

@ -1,4 +1,6 @@
import logging
from typing import Any
from llvmlite import ir
from pythonbpf.local_symbol import LocalSymbol
@ -40,6 +42,15 @@ class VmlinuxHandler:
and self.vmlinux_symtab[name].value_type == AssignmentType.CONSTANT
)
def get_struct_debug_info(self, name: str) -> Any:
if (
name in self.vmlinux_symtab
and self.vmlinux_symtab[name].value_type == AssignmentType.STRUCT
):
return self.vmlinux_symtab[name].debug_info
else:
raise ValueError(f"{name} is not a vmlinux struct type")
def get_vmlinux_struct_type(self, name):
"""Check if name is a vmlinux struct type"""
if (