mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
parse context from first function argument to local symbol table
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import ast
|
||||
|
||||
from pythonbpf.vmlinux_parser.vmlinux_exports_handler import VmlinuxHandler
|
||||
|
||||
|
||||
class VmlinuxHandlerRegistry:
|
||||
"""Registry for vmlinux handler operations"""
|
||||
@ -7,7 +9,7 @@ class VmlinuxHandlerRegistry:
|
||||
_handler = None
|
||||
|
||||
@classmethod
|
||||
def set_handler(cls, handler):
|
||||
def set_handler(cls, handler: VmlinuxHandler):
|
||||
"""Set the vmlinux handler"""
|
||||
cls._handler = handler
|
||||
|
||||
@ -43,3 +45,10 @@ class VmlinuxHandlerRegistry:
|
||||
if cls._handler is None:
|
||||
return False
|
||||
return cls._handler.is_vmlinux_struct(name)
|
||||
|
||||
@classmethod
|
||||
def get_struct_type(cls, name):
|
||||
"""Try to handle a struct name as vmlinux struct"""
|
||||
if cls._handler is None:
|
||||
return None
|
||||
return cls._handler.get_vmlinux_struct_type(name)
|
||||
|
||||
Reference in New Issue
Block a user