Sign in Join

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

Mailing lists / lazarus / 2010-05

Structured info on class watch

15 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

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

Krisztián Nagy

Hi Lazarus list,

I have a question about debugging: when I a debug a program in Lazarus and point with the mouse to a class instance identifier, then in a hint the current values of the fields of that class instance are shown in a structured way (in multiple lines and with indenting). How can I get the same output in an IDE window? Watches displays everything in one line (and the horizontal scrollbar indicates everything is visible, though many fields are not).
I didn't find the answer on the wiki.
I'm using lazarus with gtk2.
Thank you in advance!

regards
Kriszti?n
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100521/c58e2f6f/attachment.html>

Reply by email

Graeme Geldenhuys
to Krisztián Nagy

2010/5/21 Kriszti?n Nagy :

current values of the fields of that class instance are shown in a structured way (in multiple lines and with indenting). How can I get the same output in an IDE window?

That is a neat idea. A Object Inspector style debug window will be pretty awesome for that.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Martin
to Graeme Geldenhuys
Graeme Geldenhuys wrote 10 lines
2010/5/21 Kriszti?n Nagy : > current values of the fields of that class instance are shown in a > structured way (in multiple lines and with indenting). How can I get the > same output in an IDE window? > That is a neat idea. A Object Inspector style debug window will be pretty awesome for that

like pressing F7 (evaluation dialog) and selecting "inspect " there ?

Reply by email

Krisztián Nagy
to Martin

Thank you, that's what I was looking for!
Somehow I didn't catch that option. Probably because this functionality is at Watch in other IDEs I know. (maybe a popup menu option at watches could be added or a section in the wiki faq)

However, I think Graeme meant a treeview like show/collapse debug window that automatically follows current state (not needing to press evaluate) which is actually still missing.

Anyway, I just wanted to see this data without having to stick the mouse pointer to an identifier, and I got it.

2010/5/21 Martin

Show quoted text 26 lines
On 21/05/2010 15:45, Graeme Geldenhuys wrote: > 2010/5/21 Kriszti?n Nagy : > > >> current values of the fields of that class instance are shown in a >> structured way (in multiple lines and with indenting). How can I get the >> same output in an IDE window? >> >> > > That is a neat idea. A Object Inspector style debug window will be > pretty awesome for that > > like pressing F7 (evaluation dialog) and selecting "inspect " there ? -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100521/00bc7a03/attachment-0001.html>

Reply by email

Michael Schnell
to Martin: like pressing F7 (evaluation dialog) and selecting "inspect " there ?
Martin wrote
like pressing F7 (evaluation dialog) and selecting "inspect " there ?

Here, Ctr-F7 is "evaluate" (but does not work as ctrl-F? is captured by KDE for "switch Desktop", but of course I can use the context menu or change the hotkey).

But now "inspect" just takes me to the "Debug Inspector" ans same just gives me a pointer value e.g. for "Label1".

What exactly did you suggest to see a structured view onto an object ?

Thanks,
-Michael

Reply by email

Graeme Geldenhuys
to Martin: like pressing F7 (evaluation dialog) and selecting "inspect " there ?
Martin wrote
like pressing F7 (evaluation dialog) and selecting "inspect " there ?

But that is not nearly like the Object Inspector dialog.

Have you ever seen InstantObjects project? They had an Object Inspector style debugging screen. It was even made into a component any developer can drop on a form, and hook up any object to monitor. All published properties and fields where shown with all there related data.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Martin
to Michael Schnell: Here, Ctr-F7 is "evaluate" (but does not work as ctrl-F? is captured by KDE for "switch…
Michael Schnell wrote 6 lines
But now "inspect" just takes me to the "Debug Inspector" ans same just gives me a pointer value e.g. for "Label1". What exactly did you suggest to see a structured view onto an object ?

try dereferencing ("^")
(that is needed in many places anyway, since gdb has often no concept of the hidden pointers in pascal)

self^

Reply by email

Michael Schnell
to Martin
Martin wrote 5 lines
try dereferencing ("^") (that is needed in many places anyway, since gdb has often no concept of the hidden pointers in pascal)

With label1^ I in fact don't see anything useful
With form1^ I see three methods (address given as "???") and Label1 with type and address as "Data"

But nothing comparable to what the "hint" display shows.

The hint display seemingly is able to work without the "^", so it should be possible to generate the same display (but scollable here) in a debug inspector view.

-Michael

Reply by email

José Mejuto
to Michael Schnell: With label1^ I in fact don't see anything useful With form1^ I see three methods (address…

Hello Lazarus-List,

Tuesday, May 25, 2010, 2:51:34 PM, you wrote:

MS> With label1^ I in fact don't see anything useful MS> With form1^ I see three methods (address given as "???") and Label1 with MS> type and address as "Data"
MS> But nothing comparable to what the "hint" display shows. MS> The hint display seemingly is able to work without the "^", so it should MS> be possible to generate the same display (but scollable here) in a debug MS> inspector view.

I had written some of that parts, the ones that tries to "deconvolute" the GDB output and render in a more "human readable" way. The problem (one of them) is that sometimes gdb handles a variable fine without dereferencing it, and sometimes it does not :( so trying to dereference it could raise and error, or not.

It works more or less (not treeview, only list-view) but I think that some changes in the way strings are being handled and other special types like variants changes something, and now the list-view works for some variables and not for others. It is quite complex, specially using different gdb versions.

I'll take a look over the code again, I hope that nothing breaks :)

Best regards, Jos?

Reply by email

Michael Schnell
to José Mejuto: MS> With label1^ I in fact don't see anything useful MS> With form1^ I see three methods…
Jos? Mejuto wrote
I'll take a look over the code again, I hope that nothing breaks :)

GREAT !
Many thanks for your work.

I found that the tree view in the Evaluate window does work when adding the "^" manually. That is a really nice feature of the IDE, only it's a shame that it's hidden because a "normal" user hardly will try this. So it would be really great if the tree view would show up on crtl-F7 as a default. (but of course the hex value of the instance pointer should be shown somehow, too)

Thanks again,
-Michael

Reply by email

Graeme Geldenhuys
to Michael Fuchs: Try "label1^.FCaption". hth Michael
Michael Fuchs wrote
Michael Schnell schrieb: > With label1^ I in fact don't see anything useful Try "label1^.FCaption".

And what if the property doesn't have a field variable? Only a getter and setter method. I still think this must be supported in the debugger (even if it can be dangerous). Delphi has had it from the start, and nobody I have seen has ever complained about the "possible" danger this can pose. The pros far outweigh the cons.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Flávio Etrusco
to Graeme Geldenhuys
Graeme Geldenhuys wrote 16 lines
On 25 May 2010 19:50, Michael Fuchs ?wrote: > Michael Schnell schrieb: >> With label1^ I in fact don't see anything useful > > Try "label1^.FCaption". And what if the property doesn't have a field variable? Only a getter and setter method. I still think this must be supported in the debugger (even if it can be dangerous). Delphi has had it from the start, and nobody I have seen has ever complained about the "possible" danger this can pose. The pros far outweigh the cons. -- Regards, ?- Graeme -

As said in previous threads, this is pending fixes in the register/fastcall calling convention in compiler and gdb...

-Fl?vio

Reply by email