From ae279a03370942e35661f0601aff51ad82cceac2 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 6 Sep 2018 11:26:24 +0000 Subject: [PATCH] fpdebug: use TFPGMap instead of TStringList. Included in patch of Issue #34225 Patch by David Jenkins git-svn-id: trunk@58892 - --- components/fpdebug/fpdbgsymtable.pas | 5 +++-- components/fpdebug/fpdbgsymtablecontext.pas | 2 +- components/fpdebug/fpimgreaderelf.pas | 6 +++--- components/fpdebug/fpimgreaderwinpe.pas | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/components/fpdebug/fpdbgsymtable.pas b/components/fpdebug/fpdbgsymtable.pas index 9d0025352f..aaccd725ef 100644 --- a/components/fpdebug/fpdbgsymtable.pas +++ b/components/fpdebug/fpdbgsymtable.pas @@ -5,10 +5,11 @@ unit fpDbgSymTable; interface uses - Classes; + DbgIntfBaseTypes, + fgl, Classes; type - TfpSymbolList= TStringList; + TfpSymbolList= specialize TFPGMap; implementation diff --git a/components/fpdebug/fpdbgsymtablecontext.pas b/components/fpdebug/fpdbgsymtablecontext.pas index 16195bb306..de120f7462 100644 --- a/components/fpdebug/fpdbgsymtablecontext.pas +++ b/components/fpdebug/fpdbgsymtablecontext.pas @@ -93,7 +93,7 @@ begin i := FFpSymbolInfo.FSymbolList.IndexOf(AName); if i > -1 then begin - val.Address:=TDbgPtr(pointer(FFpSymbolInfo.FSymbolList.Objects[i])); + val.Address:=FFpSymbolInfo.FSymbolList.Data[i]; val.MType:=mlfTargetMem; result := TFpDbgValueConstAddress.Create(val); end diff --git a/components/fpdebug/fpimgreaderelf.pas b/components/fpdebug/fpimgreaderelf.pas index fba7a048cc..50445c1f0a 100644 --- a/components/fpdebug/fpimgreaderelf.pas +++ b/components/fpdebug/fpimgreaderelf.pas @@ -33,7 +33,7 @@ interface uses Classes, SysUtils, FpImgReaderBase, - fpDbgSymTable, + fpDbgSymTable, DbgIntfBaseTypes, FpImgReaderElfTypes, LCLProc; // these files are part of @@ -363,7 +363,7 @@ begin if SymbolArr64^[i].st_name<>0 then begin SymbolName:=pchar(SymbolStr+SymbolArr64^[i].st_name); - AfpSymbolInfo.AddObject(SymbolName, TObject(PtrUInt(SymbolArr64^[i].st_value+ImageBase))); + AfpSymbolInfo.Add(SymbolName, TDbgPtr(SymbolArr64^[i].st_value+ImageBase)); end; {$pop} end @@ -379,7 +379,7 @@ begin if SymbolArr32^[i].st_name<>0 then begin SymbolName:=pchar(SymbolStr+SymbolArr32^[i].st_name); - AfpSymbolInfo.AddObject(SymbolName, TObject(PtrUInt(SymbolArr32^[i].st_value+ImageBase))); + AfpSymbolInfo.Add(SymbolName, TDBGPtr(SymbolArr32^[i].st_value+ImageBase)); end; end end; diff --git a/components/fpdebug/fpimgreaderwinpe.pas b/components/fpdebug/fpimgreaderwinpe.pas index 4b9107af46..2ad13dadf7 100644 --- a/components/fpdebug/fpimgreaderwinpe.pas +++ b/components/fpdebug/fpimgreaderwinpe.pas @@ -40,7 +40,7 @@ interface uses Classes, SysUtils, math, FpImgReaderBase, FpImgReaderWinPETypes, LazLoggerBase, - fpDbgSymTable; + fpDbgSymTable, DbgIntfBaseTypes; type @@ -152,7 +152,7 @@ begin end; end; end; - AfpSymbolInfo.AddObject(SymbolName, TObject(PtrUInt(SymbolArr^[i].Value+ImageBase+FCodeBase))); + AfpSymbolInfo.Add(SymbolName, TDBGPtr(SymbolArr^[i].Value+ImageBase+FCodeBase)); end end; {$POP}