From 45094bcabe71574eb2d8d31d72f821a25d406ec1 Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 20 May 2024 20:02:51 +0200 Subject: [PATCH] FpDebug: add DW_OP_stack_value --- components/fpdebug/fpdbgdwarfconst.pas | 2 ++ components/fpdebug/fpdbgdwarfdataclasses.pas | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/components/fpdebug/fpdbgdwarfconst.pas b/components/fpdebug/fpdbgdwarfconst.pas index 981e495f47..657f60ff88 100644 --- a/components/fpdebug/fpdbgdwarfconst.pas +++ b/components/fpdebug/fpdbgdwarfconst.pas @@ -381,6 +381,8 @@ const DW_OP_form_tls_address = $9b; // 0 DW_OP_call_frame_cfa = $9c; // 0 DW_OP_bit_piece = $9d; // 2 + // --- DWARF4 --- + DW_OP_stack_value = $9f; // 0 // --- --- DW_OP_lo_user = $e0; // DW_OP_hi_user = $ff; // diff --git a/components/fpdebug/fpdbgdwarfdataclasses.pas b/components/fpdebug/fpdbgdwarfdataclasses.pas index 5b4be5e8c4..7477da9c4f 100644 --- a/components/fpdebug/fpdbgdwarfdataclasses.pas +++ b/components/fpdebug/fpdbgdwarfdataclasses.pas @@ -2633,6 +2633,12 @@ begin DW_OP_call_frame_cfa = $9c; // 0 DW_OP_bit_piece = $9d; // 2 *) + // dwarf 4 + DW_OP_stack_value: begin + EntryP := FStack.Peek; + EntryP^.MType := mlfConstantDeref; + end; + else begin debugln(FPDBG_DWARF_ERRORS, ['DWARF ERROR in TDwarfLocationExpression.Evaluate UNKNOWN ', CurInstr^]);