Recent

Author Topic: Features - as started in "new splash" thread  (Read 1191 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: Features - as started in "new splash" thread
« Reply #15 on: November 07, 2024, 09:27:42 pm »
3. Still some very annoying things, but I think thats not much one can do about, e.g. debugging list classes that do raw memory allocations is rough. If there would be the ability to define certain attributes to be embedded into the debug info, e.g. for containers marking the count and indexed access properties so the debugger can display them as a list or something would be great.

That depends on if the real type of the data has a typename.

If the raw memory is at FList.FData then you can do a watch like
Code: Text  [Select][+][-]
  1. ^TDataType(FList.FData)[0..FList.FCount-1]

Using the "inspect" dialog can help to click to the fields, copy e.g. the FList.FCount, and put it all together.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: Features - as started in "new splash" thread
« Reply #16 on: November 07, 2024, 09:49:30 pm »
Further more
Code: Pascal  [Select][+][-]
  1. program Project1;
  2. uses fgl;
  3. type TFoo = specialize TFPGList<integer>;
  4. var f: TFoo;
  5. begin
  6.   f := TFoo.Create;
  7.   f.Add(1);
  8.  

You can watch  (for any index you want)
Code: Text  [Select][+][-]
  1. FList.Get(0)

However, the address of function "get" is not always in the debug info.
The function must at least be used in the project, or it wont be compiled into the exe.

If the function is virtual, then it will likely work well. Otherwise it may depend on the target OS. Though Lazarus 4.0 has gotten better at getting the address.


You have to enable function calling for watches. Global options, and in watch properties
« Last Edit: November 07, 2024, 09:51:06 pm by Martin_fr »

 

TinyPortal © 2005-2018