mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
add function_debug_info.py and format
This commit is contained in:
9
pythonbpf/functions/function_debug_info.py
Normal file
9
pythonbpf/functions/function_debug_info.py
Normal file
@ -0,0 +1,9 @@
|
||||
import ast
|
||||
|
||||
import llvmlite.ir as ir
|
||||
|
||||
|
||||
def generate_function_debug_info(
|
||||
func_node: ast.FunctionDef, module: ir.Module, func: ir.Function
|
||||
):
|
||||
pass
|
||||
@ -23,7 +23,7 @@ from pythonbpf.allocation_pass import (
|
||||
create_targets_and_rvals,
|
||||
LocalSymbol,
|
||||
)
|
||||
|
||||
from .function_debug_info import generate_function_debug_info
|
||||
from .return_utils import handle_none_return, handle_xdp_return, is_xdp_name
|
||||
from .function_metadata import get_probe_string, is_global_function, infer_return_type
|
||||
|
||||
@ -440,7 +440,7 @@ def func_proc(tree, module, chunks, map_sym_tab, structs_sym_tab):
|
||||
func_type = get_probe_string(func_node)
|
||||
logger.info(f"Found probe_string of {func_node.name}: {func_type}")
|
||||
|
||||
process_bpf_chunk(
|
||||
func = process_bpf_chunk(
|
||||
func_node,
|
||||
module,
|
||||
ctypes_to_ir(infer_return_type(func_node)),
|
||||
@ -448,6 +448,9 @@ def func_proc(tree, module, chunks, map_sym_tab, structs_sym_tab):
|
||||
structs_sym_tab,
|
||||
)
|
||||
|
||||
logger.info(f"Generating Debug Info for Function {func_node.name}")
|
||||
generate_function_debug_info(func_node, module, func)
|
||||
|
||||
|
||||
# TODO: WIP, for string assignment to fixed-size arrays
|
||||
def assign_string_to_array(builder, target_array_ptr, source_string_ptr, array_length):
|
||||
|
||||
Reference in New Issue
Block a user