Recent

Author Topic: Debugging generics in Lazarus IDE  (Read 2828 times)

lolka_bolka

  • Newbie
  • Posts: 3
Debugging generics in Lazarus IDE
« on: May 24, 2018, 10:42:27 pm »
Guys, I am crying.

Please somebody enlighten me about this:

I have this:

TDictionaryStrInt = specialize TFPGMap<string, integer>;
Can somebody tell me how the heck can I debug the Map, the Key/Value pairs?

I just see only reference to a memory address, but I really need to see the items.

Watch, local variables does not helps me.

I can see only this:

Code: Pascal  [Select][+][-]
  1.  
  2. <TDictionaryStrStr> = {
  3.   <TFPSMAP> = {
  4.      <TFPSLIST> = {
  5.        <TOBJECT> = {
  6.          _vptr$ = {
  7.            0x5612ec,
  8.            0x230b988}},
  9.       FLIST = ,
  10.       FCOUNT = 1,
  11.       FCAPACITY = 4,
  12.       FITEMSIZE = 8},
  13.      FKEYSIZE = 4,
  14.      FDATASIZE = 4,
  15.     FDUPLICATES = DUPIGNORE,
  16.     FSORTED = false,
  17.     FONKEYPTRCOMPARE = $426b70 <TFPGMAP$2$CRC36DB32B4__KEYCOMPARE>,
  18.     FONDATAPTRCOMPARE = $523e30
  19.  <FGL$_$TFPSMAP_$__$$_BINARYCOMPAREDATA$POINTER$POINTER$$LONGINT>},
  20.   FONKEYCOMPARE = $0,
  21.   FONDATACOMPARE = $0}
  22.  
  23.  

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Debugging generics in Lazarus IDE
« Reply #1 on: May 24, 2018, 11:52:31 pm »
This isnt really a debugger problem.
If you follow the code into the map, you will see it stores it data in flist, and flist is a PByte.

Items are accessed by
    FList+Index*ItemSize

So you need to follow the code, to understand the full structure that is hidden behind the PByte.

 

TinyPortal © 2005-2018