static void
sframe_fde_free (struct sframe_func_entry *sframe_fde)
{
- sframe_row_entry_free (sframe_fde->sframe_fres);
+ if (sframe_fde == NULL)
+ return;
+
+ if (sframe_fde->sframe_fres)
+ sframe_row_entry_free (sframe_fde->sframe_fres);
+
XDELETE (sframe_fde);
}
/* Initialize the translation context with information anew. */
sframe_xlate_ctx_init (xlate_ctx);
- /* Process and link SFrame FDEs if no error. Also skip adding an SFrame
- FDE if it does not contain any SFrame FREs. There is little use of an
- SFrame FDE if there is no stack tracing information for the
- function. */
+ /* Process and link SFrame FDEs if no error. */
int err = sframe_do_fde (xlate_ctx, dw_fde);
- if (err || xlate_ctx->num_xlate_fres == 0)
+ if (err && get_dw_fde_signal_p (dw_fde))
+ {
+ sframe_xlate_ctx_cleanup (xlate_ctx);
+ err = SFRAME_XLATE_OK;
+ }
+
+ if (err)
{
sframe_xlate_ctx_cleanup (xlate_ctx);
sframe_fde_free (sframe_fde);
--- /dev/null
+#as: --gsframe
+#warning: \.cfi\_escape with op \(0xf\)
+#objdump: --sframe=.sframe
+#name: Signal Frame with no FREs
+#...
+Contents of the SFrame section .sframe:
+ Header :
+
+ Version: SFRAME_VERSION_3
+ Flags: SFRAME_F_FDE_FUNC_START_PCREL
+ CFA fixed RA offset: -8
+ Num FDEs: 1
+ Num FREs: 0
+
+ Function Index :
+
+ func idx \[0\]: pc = 0x0, size = 3 bytes, attr = "S"
+ STARTPC + CFA + FP + RA +
--- /dev/null
+ .type foo, @function
+foo:
+ .cfi_startproc
+ .cfi_signal_frame
+# DW_CFA_def_cfa_expression, length, DW_OP_breg9, (sleb)offset, DW_OP_deref
+ .cfi_escape 0xf,0x3,0x79,0x78,0x6
+ nop
+ pop %rbp
+ .cfi_offset 6, -16
+ ret
+ .cfi_endproc
+ .size foo, .-foo
run_dump_test "cfi-sframe-x86_64-2"
run_dump_test "cfi-sframe-x86_64-3"
run_dump_test "cfi-sframe-x86_64-pr33170"
+ run_dump_test "cfi-sframe-x86_64-signal-1"
run_dump_test "cfi-sframe-x86_64-empty-1"
run_dump_test "cfi-sframe-x86_64-empty-2"
run_dump_test "cfi-sframe-x86_64-empty-3"