Recent

Author Topic: Watching TStringList - Lazarus 3.0 (FpDebug)  (Read 4291 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9354
  • Debugger - SynEdit - and more
    • wiki
Watching TStringList - Lazarus 3.0 (FpDebug)
« on: July 03, 2023, 02:28:53 pm »
Well, sorry, but no, properties still don't work....

But, now there is a way to see the contents of your StringList. (Using FpDebug and Dwarf-3 / other Dwarf versions should work too)

Code: Pascal  [Select][+][-]
  1. program Project1;
  2. uses Classes;
  3. var
  4.   MyList: TStringList;
  5. begin
  6.   MyList := TStringList.Create;
  7.   MyList.Add('abc');
  8.   MyList.Add('123');
  9.   MyList.Add('Foo'+LineEnding+'Bar');
  10.   MyList.Add('whatever');
  11. end.

In the watches window (or debug-inspect / evaluate) add this:
Code: Text  [Select][+][-]
  1. MyList.FList^[0..3].FString
And see the image for the result.

https://wiki.freepascal.org/FpDebug-Watches-Intrinsic-Functions#Array_slice_MyArray.5Bn..m.5D_with_mapping

andresayang

  • Full Member
  • ***
  • Posts: 107
Re: Watching TStringList - Lazarus 3.0 (FpDebug)
« Reply #1 on: October 26, 2023, 02:16:13 pm »
Hello,

I've try even with your "trick" doesn't seems to works.

Cheers
Linux, Debian 12
Lazarus: always latest release

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4370
  • I like bugs.
Re: Watching TStringList - Lazarus 3.0 (FpDebug)
« Reply #2 on: October 27, 2023, 08:28:16 am »
I've try even with your "trick" doesn't seems to works.
I tested with Lazarus trunk (main branch) and with fixes_3_0. It works here!
However I don't know what the arrow buttons are supposed to do. Clicking them makes no difference.
The "+" and "-" buttons change the number in between them, but what is its purpose? The range is already given by a user.

Anyways a nice feature.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

andresayang

  • Full Member
  • ***
  • Posts: 107
Re: Watching TStringList - Lazarus 3.0 (FpDebug)
« Reply #3 on: October 27, 2023, 12:35:43 pm »
I've try even with your "trick" doesn't seems to works.
I tested with Lazarus trunk (main branch) and with fixes_3_0. It works here!
However I don't know what the arrow buttons are supposed to do. Clicking them makes no difference.
The "+" and "-" buttons change the number in between them, but what is its purpose? The range is already given by a user.

Anyways a nice feature.

Thanks,

So I'll try to install "RC2" to check.

Cheers
Linux, Debian 12
Lazarus: always latest release

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9354
  • Debugger - SynEdit - and more
    • wiki
Re: Watching TStringList - Lazarus 3.0 (FpDebug)
« Reply #4 on: October 27, 2023, 07:43:19 pm »
However I don't know what the arrow buttons are supposed to do. Clicking them makes no difference.
The "+" and "-" buttons change the number in between them, but what is its purpose? The range is already given by a user.

They are for any array, but only do something if there are more than 10 entries.
 
Then you see a page of 10, and can go through the pages.

The +/- change the size of the page.

https://wiki.freepascal.org/IDE_Window:_Watch_list#Viewing.2FExpanding_Arrays

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4370
  • I like bugs.
Re: Watching TStringList - Lazarus 3.0 (FpDebug)
« Reply #5 on: October 27, 2023, 11:17:00 pm »
They are for any array, but only do something if there are more than 10 entries.
Then you see a page of 10, and can go through the pages.
The +/- change the size of the page.
https://wiki.freepascal.org/IDE_Window:_Watch_list#Viewing.2FExpanding_Arrays
OK, sounds like a useful feature for some advanced debugging situations. I must test it further at some point.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

andresayang

  • Full Member
  • ***
  • Posts: 107
Re: Watching TStringList - Lazarus 3.0 (FpDebug)
« Reply #6 on: November 06, 2023, 01:07:34 am »
Hi all,

3.0 RC2 (that I manage to install, using "first build as root trick)

I got it, thanks a lots for this wonderfull feature.

Cheers
Linux, Debian 12
Lazarus: always latest release

 

TinyPortal © 2005-2018