github.com/undoio/delve@v1.9.0/pkg/proc/internal/ebpf/bpf/include/function_vals.bpf.h (about)

     1  #include <stdbool.h>
     2  
     3  // function_parameter stores information about a single parameter to a function.
     4  typedef struct function_parameter {
     5        // Type of the parameter as defined by the reflect.Kind enum.
     6        unsigned int kind; 
     7        // Size of the variable in bytes.
     8        unsigned int size; 
     9  
    10        // Offset from stack pointer. This should only be set from the Go side.
    11        int offset;
    12  
    13        // If true, the parameter is passed in a register.
    14        bool in_reg;      
    15        // The number of register pieces the parameter is passed in.
    16        int n_pieces;
    17        // If in_reg is true, this represents the registers that the parameter is passed in.
    18        // This is an array because the number of registers may vary and the parameter may be
    19        // passed in multiple registers.
    20        int reg_nums[6]; 
    21  
    22        // The following are filled in by the eBPF program.
    23        size_t daddr;   // Data address.
    24        char val[0x30];       // Value of the parameter.
    25        char deref_val[0x30]; // Dereference value of the parameter.
    26  } function_parameter_t;
    27  
    28  // function_parameter_list holds info about the function parameters and
    29  // stores information on up to 6 parameters.
    30  typedef struct function_parameter_list {
    31        unsigned int goid_offset; // Offset of the `goid` struct member.
    32        long long g_addr_offset;  // Offset of the Goroutine struct from the TLS segment.
    33        int goroutine_id;
    34  
    35        unsigned int fn_addr;
    36        bool is_ret;
    37  
    38        unsigned int n_parameters;          // number of parameters.
    39        function_parameter_t params[6];     // list of parameters.
    40  
    41        unsigned int n_ret_parameters;      // number of return parameters.
    42        function_parameter_t ret_params[6]; // list of return parameters.
    43  } function_parameter_list_t;