Sign in Join

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

Mailing lists / lazarus / 2011-01

Displaying property values while debugging

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Bo Berglund

While debugging my test database application I tried to do as I ussually do in Delphi to see property values, namely to hover the mouse over a keyword when the execution has stopped in a breakpoint.

In Delphi I usually see the value of the property, but here in lazarus I only see a pop-up message about an exception...

in my case I put the cursor in the Text word of the sentence below:

  query.SQL.Text := 'EXEC SelectDongleData @@SerialNo=2485';
The breakpoint has been reached on the next line: query.Open;

When I now hover the mouse over 'Text' then after a while a yellow box appears with the following content:

-------
query.SQL.Text := 'EXEC SelectDongleData @@SerialNo=2485';
= A syntax error in expression, near 'query.SQL.Text := 'EXEC
SelectDongleData @@SerialNo=2485';

public property TStrings.Text
C:\Programs\fpc\2.4.2\source\rtl\objpas\clases\classesh.inc (638,14) -------

What is this problem caused by?
Do I have to do something to enable these tooltips with current values of properties?

Bo Berglund Developer in Sweden

Reply by email

Martin
to Bo Berglund
Bo Berglund wrote 15 lines
While debugging my test database application I tried to do as I ussually do in Delphi to see property values, namely to hover the mouse over a keyword when the execution has stopped in a breakpoint. In Delphi I usually see the value of the property, but here in lazarus I only see a pop-up message about an exception... in my case I put the cursor in the Text word of the sentence below: query.SQL.Text := 'EXEC SelectDongleData @@SerialNo=2485'; The breakpoint has been reached on the next line: query.Open; When I now hover the mouse over 'Text' then after a while a yellow box appears with the following content:

http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Properties

properties that have a getter, need to call a function to get the value. The debugger currently can't do this.

Reply by email

Bo Berglund
to Martin
Martin wrote 20 lines
On 23/01/2011 20:29, Bo Berglund wrote: > While debugging my test database application I tried to do as I > ussually do in Delphi to see property values, namely to hover the > mouse over a keyword when the execution has stopped in a breakpoint. > > In Delphi I usually see the value of the property, but here in lazarus > I only see a pop-up message about an exception... > > in my case I put the cursor in the Text word of the sentence below: > > query.SQL.Text := 'EXEC SelectDongleData @@SerialNo=2485'; > > The breakpoint has been reached on the next line: query.Open; > > When I now hover the mouse over 'Text' then after a while a yellow box > appears with the following content: http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Properties properties that have a getter, need to call a function to get the value. The debugger currently can't do this.

Too bad, but since is a limitation I won't look further. Thanks!

Bo Berglund Developer in Sweden

Reply by email

Martin
to Bo Berglund
Bo Berglund wrote 11 lines
On Sun, 23 Jan 2011 23:46:55 +0000, Martin wrote: > On 23/01/2011 20:29, Bo Berglund wrote: >> While debugging my test database application I tried to do as I >> ussually do in Delphi to see property values, namely to hover the >> mouse over a keyword when the execution has stopped in a breakpoint. > http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Properties > > properties that have a getter, need to call a function to get the value. > The debugger currently can't do this. Too bad, but since is a limitation I won't look further. Thanks!

Often you can work around those problems.

You look at the property and it's getter, and see where it get's it's data. then you create a watch to display it.

Unless it really does need processing. That is, if reading the property, does actually need to call the mysql server, then you can not get the data. But then if you actually would make that kind of call, you may change the mysql server state, or the app state, and change the outcome of the entire remaining code of your app. (Once property getters can be called... And then it's a risk, your app may or may not be affected by the extra call)

Also the other thing, if the getter point to a variable "property foo: integer read FFoo;", then make sure you compile it with dwarf (-gw) Also make sure the LCL is compile with dwarf.
And the package containing the database code, should also be compiled using dwarf.

dwarf: actually -gw and -godwarfsets (the 2nd you have to specify by hand, in the extra options field)

----
I am using that debugging the entire IDE itself. And not once have I yet failed to get the data I wanted to see (well maybe once, but really rarely). True, it could be more convenient and all.

----------
Actually, just reviewing your original post:

------- query.SQL.Text := 'EXEC SelectDongleData @@SerialNo=2485'; = A syntax error in expression, near 'query.SQL.Text := 'EXEC SelectDongleData @@SerialNo=2485';

it should only sent "query.SQL.Text" to the debugger (which may or may not work, see the rwest of the post) => but the whole other ":= '...'" psacal statement shouldn't go to the debugger.
It is not by any change selected as block?

Does it work as watch (just "query.SQL.Text" ) ?

Martin

Reply by email