Skip to content

Commit

Permalink
pkg/proc/internal/ebpf: Fix size of ebpf type for fn_addr (go-delve#3080
Browse files Browse the repository at this point in the history
)

Must have been an issue overlooked in the initial implementation but
we should be using a 64-bit wide type to store the function address.
  • Loading branch information
derekparker authored Jul 28, 2022
1 parent 6ad3169 commit 36b35aa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/proc/internal/ebpf/bpf/include/function_vals.bpf.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ typedef struct function_parameter_list {
long long g_addr_offset; // Offset of the Goroutine struct from the TLS segment.
int goroutine_id;

unsigned int fn_addr;
unsigned long long int fn_addr;
bool is_ret;

unsigned int n_parameters; // number of parameters.
Expand Down
4 changes: 2 additions & 2 deletions pkg/proc/internal/ebpf/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type function_parameter_list_t struct {
goid_offset uint32
g_addr_offset uint64
goroutine_id uint32
fn_addr uint32
fn_addr uint64
is_ret bool

n_parameters uint32
Expand Down Expand Up @@ -197,7 +197,7 @@ func parseFunctionParameterList(rawParamBytes []byte) RawUProbeParams {
func createFunctionParameterList(entry uint64, goidOffset int64, args []UProbeArgMap, isret bool) function_parameter_list_t {
var params function_parameter_list_t
params.goid_offset = uint32(goidOffset)
params.fn_addr = uint32(entry)
params.fn_addr = entry
params.is_ret = isret
params.n_parameters = 0
params.n_ret_parameters = 0
Expand Down
Binary file modified pkg/proc/internal/ebpf/trace_bpfel_x86.o
Binary file not shown.

0 comments on commit 36b35aa

Please sign in to comment.