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