aboutsummaryrefslogtreecommitdiff
path: root/gdb/symmisc.c
diff options
context:
space:
mode:
authorGuinevere Larsen <blarsen@redhat.com>2023-11-01 17:25:32 +0100
committerGuinevere Larsen <blarsen@redhat.com>2024-01-02 10:21:37 +0100
commit528b729be1a293a21f44149351f3eba5b4e2d870 (patch)
tree3959ec9a424c769dfeffe89440fc4c6165df3916 /gdb/symmisc.c
parentb22ee0e49ba2bac8a5295f0426c62e9bd2b311a1 (diff)
downloadbinutils-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/symmisc.c')
-rw-r--r--gdb/symmisc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index c1a6ab5..2e500e8 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -973,13 +973,14 @@ maintenance_print_one_line_table (struct symtab *symtab, void *data)
/* Leave space for 6 digits of index and line number. After that the
tables will just not format as well. */
struct ui_out *uiout = current_uiout;
- ui_out_emit_table table_emitter (uiout, 6, -1, "line-table");
+ ui_out_emit_table table_emitter (uiout, 7, -1, "line-table");
uiout->table_header (6, ui_left, "index", _("INDEX"));
uiout->table_header (6, ui_left, "line", _("LINE"));
uiout->table_header (18, ui_left, "rel-address", _("REL-ADDRESS"));
uiout->table_header (18, ui_left, "unrel-address", _("UNREL-ADDRESS"));
uiout->table_header (7, ui_left, "is-stmt", _("IS-STMT"));
uiout->table_header (12, ui_left, "prologue-end", _("PROLOGUE-END"));
+ uiout->table_header (14, ui_left, "epilogue-begin", _("EPILOGUE-BEGIN"));
uiout->table_body ();
for (int i = 0; i < linetable->nitems; ++i)
@@ -999,6 +1000,7 @@ maintenance_print_one_line_table (struct symtab *symtab, void *data)
CORE_ADDR (item->unrelocated_pc ()));
uiout->field_string ("is-stmt", item->is_stmt ? "Y" : "");
uiout->field_string ("prologue-end", item->prologue_end ? "Y" : "");
+ uiout->field_string ("epilogue-begin", item->epilogue_begin ? "Y" : "");
uiout->text ("\n");
}
}