Skip to content

[BPF] override getFrameIndexReference to fix stack offset calculation#3

Draft
bidhan-a wants to merge 1 commit intoblueshift-gg:upstream-gallery-21from
bidhan-a:fix/bpf-getFrameIndexReference
Draft

[BPF] override getFrameIndexReference to fix stack offset calculation#3
bidhan-a wants to merge 1 commit intoblueshift-gg:upstream-gallery-21from
bidhan-a:fix/bpf-getFrameIndexReference

Conversation

@bidhan-a
Copy link

Summary

The BPF backend did not override getFrameIndexReference() so the base class default impl added StackSize to frame object offsets. This is not needed for BPF where R10 is a fixed frame pointer and stack object offsets are already relative to it

This shifted all stack variable locations by StackSize, resulting in incorrect DWARF debug info.

Example

Before:

from_account:  DW_AT_location (DW_OP_reg10 W10)
to_account:    DW_AT_location (DW_OP_fbreg +8, DW_OP_stack_value)

After:

from_account:  DW_AT_location (DW_OP_fbreg -2040, DW_OP_stack_value)
to_account:    DW_AT_location (DW_OP_fbreg -2040, DW_OP_plus_uconst 0x8, DW_OP_stack_value)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant