diff options
author | Guinevere Larsen <blarsen@redhat.com> | 2023-11-01 17:25:32 +0100 |
---|---|---|
committer | Guinevere Larsen <blarsen@redhat.com> | 2024-01-02 10:21:37 +0100 |
commit | 528b729be1a293a21f44149351f3eba5b4e2d870 (patch) | |
tree | 3959ec9a424c769dfeffe89440fc4c6165df3916 /gdb/testsuite/lib | |
parent | b22ee0e49ba2bac8a5295f0426c62e9bd2b311a1 (diff) | |
download | binutils-528b729be1a293a21f44149351f3eba5b4e2d870.zip binutils-528b729be1a293a21f44149351f3eba5b4e2d870.tar.gz binutils-528b729be1a293a21f44149351f3eba5b4e2d870.tar.bz2 |
gdb/dwarf2: Add support for DW_LNS_set_epilogue_begin in line-table
This commit adds a mechanism for GDB to detect the linetable opcode
DW_LNS_set_epilogue_begin. This opcode is set by compilers to indicate
that a certain instruction marks the point where the frame is destroyed.
While the standard allows for multiple points marked with epilogue_begin
in the same function, for performance reasons, the function that
searches for the epilogue address will only find the last address that
sets this flag for a given block.
This commit also changes amd64_stack_frame_destroyed_p_1 to attempt to
use the epilogue begin directly, and only if an epilogue can't be found
will it attempt heuristics based on the current instruction.
Finally, this commit also changes the dwarf assembler to be able to emit
epilogue-begin instructions, to make it easier to test this patch
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r-- | gdb/testsuite/lib/dwarf.exp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp index a9b5be8..934cc47 100644 --- a/gdb/testsuite/lib/dwarf.exp +++ b/gdb/testsuite/lib/dwarf.exp @@ -2387,13 +2387,13 @@ namespace eval Dwarf { _op .byte $_default_is_stmt "default_is_stmt" _op .byte 1 "line_base" _op .byte 1 "line_range" - _op .byte 11 "opcode_base" + _op .byte 12 "opcode_base" # The standard_opcode_lengths table. The number of arguments - # for each of the standard opcodes. Generating 10 entries here - # matches the use of 11 in the opcode_base above. These 10 + # for each of the standard opcodes. Generating 11 entries here + # matches the use of 12 in the opcode_base above. These 10 # entries match the 9 standard opcodes for DWARF2 plus - # DW_LNS_prologue_end from DWARF3. + # DW_LNS_prologue_end and DW_LNS_epilogue_begin from DWARF3. _op .byte 0 "standard opcode 1" _op .byte 1 "standard opcode 2" _op .byte 1 "standard opcode 3" @@ -2404,6 +2404,7 @@ namespace eval Dwarf { _op .byte 0 "standard opcode 8" _op .byte 1 "standard opcode 9" _op .byte 0 "standard opcode 10" + _op .byte 0 "standard opcode 11" # Add a directory entry to the line table header's directory table. # @@ -2601,6 +2602,10 @@ namespace eval Dwarf { _op .byte 0x0a } + proc DW_LNS_set_epilogue_begin {} { + _op .byte 0x0b + } + proc DW_LNS_advance_pc {offset} { _op .byte 2 _op .uleb128 ${offset} |