From a7d0a6e0b295d2d5afe992d1d1ac678c727669fb Mon Sep 17 00:00:00 2001 From: Joost van der Sluis Date: Sun, 3 Jul 2022 18:41:56 +0200 Subject: [PATCH] FpDebug: Keep register-names in stacktrace --- components/fpdebug/fpdbgdwarfcfi.pas | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/components/fpdebug/fpdbgdwarfcfi.pas b/components/fpdebug/fpdbgdwarfcfi.pas index 510ab39891..2d08fb3d32 100644 --- a/components/fpdebug/fpdbgdwarfcfi.pas +++ b/components/fpdebug/fpdbgdwarfcfi.pas @@ -647,6 +647,7 @@ var i: Integer; ReturnAddress, Value: TDbgPtr; FrameBase: TDBGPtr; + RegName: String; begin Result := False; NewCallStackEntry := nil; @@ -706,7 +707,14 @@ begin for i := 0 to High(Row.RegisterArray) do begin if ProcessCFIColumn(Row, i, FrameBase, Size, CurrentCallStackEntry, Value) then - NewCallStackEntry.RegisterValueList.DbgRegisterAutoCreate[IntToStr(i)].SetValue(Value, IntToStr(Value),Size, i); + begin + Reg := CurrentCallStackEntry.RegisterValueList.FindRegisterByDwarfIndex(i); + if Assigned(Reg) then + RegName := Reg.Name + else + RegName := IntToStr(i); + NewCallStackEntry.RegisterValueList.DbgRegisterAutoCreate[RegName].SetValue(Value, IntToStr(Value),Size, i); + end; end; end;