Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-02

Watches - 'Repeat Count' functionality.

7 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

I'm using Lazarus 1.5 r47664 FPC 2.6.4 x86_64-linux-gtk 2

I looked at the following documentation regarding "repeat count"

http://wiki.lazarus.freepascal.org/IDE_Window:_Watch_list#Watch_Properties

In the wiki it says "Repeat Count" was implemented in Lazarus 1.1 already (see the bottom of the section in the wiki), but I can't seem to get it to work in Lazarus 1.5. I only ever see the first element specified. eg: b[10] and then a repeat count of 5, but I only see b[10]'s value.

I tried using both GDB and fpDebug debuggers.

Is this actually implemented, or am I using it wrong?

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Martin Frb
to Graeme Geldenhuys
Graeme Geldenhuys wrote 17 lines
Hi, I'm using Lazarus 1.5 r47664 FPC 2.6.4 x86_64-linux-gtk 2 I looked at the following documentation regarding "repeat count" http://wiki.lazarus.freepascal.org/IDE_Window:_Watch_list#Watch_Properties In the wiki it says "Repeat Count" was implemented in Lazarus 1.1 already (see the bottom of the section in the wiki), but I can't seem to get it to work in Lazarus 1.5. I only ever see the first element specified. eg: b[10] and then a repeat count of 5, but I only see b[10]'s value. I tried using both GDB and fpDebug debuggers. Is this actually implemented, or am I using it wrong?

how is b defined?

IIRC (need to check) repeat count cuts off at the boundaries of an array b: array [3..10] of integer
will never show b[11].

But ^integer(@b[10])[0] will show it

Also, if you use the "detail pane" in watches. This had a bug, that was fixed only recently. But the "value column" should be fine.

Otherwise can you get a lof:
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debug_session

Reply by email

Graeme Geldenhuys
to Martin Frb
Martin Frb wrote
how is b defined?
=====================================
program project1;
uses
  SysUtils;
var
  a: array[0..999] of integer;
  b: array[0..100] of string;
  i: integer;
begin
  writeln('Let''s start');
  for i := 0 to 999 do
    a[i] := i;
//  writeln('a[0] = ', a[0]);
  for i := 0 to 99 do
    b[i] := 'str' + IntToStr(i);
  writeln('b[0] = ', b[0]);   //  <-- Breakpoint is set here
  writeln('That''s all folks!');
end.
=====================================
IIRC (need to check) repeat count cuts off at the boundaries of an array

No, the repeat count would have been well within the bounds of the array.

Also, if you use the "detail pane" in watches. This had a bug,

No, didn't even know there was "detail pane". :)

I was just evaluating the latest debugging features in Lazarus IDE, and comparing GDB and fpDebug output.

I also wanted to see if Lazarus IDE had something like Haiku's Debugger has - Array Ranges. If it didn't (Repeat Count seems close), I thought I might take a shot at implementing it. It doesn't seem too hard to accomplish [please correct me if I am wrong].

https://www.haiku-os.org/blog/anevilyak/2013-04-27_debugger_overview_new_features

https://www.haiku-os.org/files/images/array_range_2.png https://www.haiku-os.org/files/images/array_range_3.png https://www.haiku-os.org/files/images/array_range_4.png

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Martin Frb
to Martin Frb
Martin Frb wrote 12 lines
On 19/02/2015 00:20, Graeme Geldenhuys wrote: > On 2015-02-18 17:08, Martin Frb wrote: >> how is b defined? > I tried this program, with {$H+} and {$H-} In both cases I got 5 strings (for a repeat count of 5) http://i.imgur.com/ZSNsTzd.png So I need a logfile please, to see why it does not work for you. http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debug_session

Just a note. This only works if you leave the watch type on "default"

Reply by email

Martin Frb
to Graeme Geldenhuys
Graeme Geldenhuys wrote
On 2015-02-19 00:57, Martin Frb wrote: > Just a note. This only works if you leave the watch type on "default" Ah, that solved it! I set it to String because I knew the array was of string type.

Yes that needs improving. But its not high priority now.

Reply by email