Sign in Join

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

Mailing lists / lazarus / 2016-10

Watch List shows absolute rubbish

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

Hi,

Is it a known issue that the Watch List shows absolute rubbish from time to time??? Or at least that you can't trust the details is does show?

Take a look at the screenshot attached. Look at the code, and the Watch window. Note the value of "i" and "FShowDeleted" in the Watch window. It is the first iteration in the "for i ..." loop, so "i" should be Zero. Now take a look at what the Watch List shows! In the second case, the FShowDeleted is a boolean field variable and currently has the value False, but again, look at what the Watch window shows.

How the hell is one supposed to do debugging like this?? I've just wasted hours debugging code, thinking that the information in the Watch List is reliable. WTF. Sorry, but I'm fuming mad at this point [if you haven't guessed].

I'm running FreeBSD 10.3 (64-bit) with 64-bit FPC 2.6.4 and Lazarus from trunk (updated 2 weeks ago). GDB version 7.11.1.

If FreeBSD is not a supported environment for Lazarus, then please state so clearly and I'll stop using Lazarus under it.

ps:
Why are some lines painted in grey in the Watch List? Does that have anything to do with this issue?

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot1.png Type: image/png Size: 17380 bytes Desc: not available URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20161014/d78b1d94/attachment-0001.png>

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys
Graeme Geldenhuys wrote
How the hell is one supposed to do debugging like this??

I guess the answer is to simply use MSEide to debug LCL applications (and all other applications too). Attached is a screenshot of the same watch list and also in the first iteration of the for loop. NOTE that MSEide does just fine displaying the _real_ values in the Watch List window.

MSEide was running under the exact same environment as what my Lazarus IDE did. Using the same FPC compiler and GDB debugger.

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot2_mseide.png Type: image/png Size: 14671 bytes Desc: not available URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20161014/d7af4d96/attachment.png>

Reply by email

Martin Frb
to Graeme Geldenhuys
Graeme Geldenhuys wrote 9 lines
On 2016-10-14 16:48, Graeme Geldenhuys via Lazarus wrote: > How the hell is one supposed to do debugging like this?? I guess the answer is to simply use MSEide to debug LCL applications (and all other applications too). Attached is a screenshot of the same watch list and also in the first iteration of the for loop. NOTE that MSEide does just fine displaying the _real_ values in the Watch List window. MSEide was running under the exact same environment as what my Lazarus IDE did. Using the same FPC compiler and GDB debugger.

And the same compiler settings?

Both on -O1 ? (or whatever level)

Such incorrect results are sometimes caused by -O1, while -O- will be fine.

Reply by email

Martin Frb
to Graeme Geldenhuys
Graeme Geldenhuys wrote 8 lines
On 2016-10-14 18:45, Martin Frb via Lazarus wrote: > And the same compiler settings? Both have the exact same compiler settings... -l -Mobjfpc -Sh -Sc -Si -gl -O- -gh -dUseCThreads -viewn I excluded the unit paths from the above list of compiler options.

Ok, thats a first, never seen that before.

Can you produce a logfile
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debug_session

If you open the "locals" window, it should have "i", same error?

What happens in mseide, if you type/watch uppercase I or FSHOWDELETED ?

For info, some previous gdb, did not find some variables, unless they where uppercased.
Normally gdb ignores case, so Lazarus uppercases all vars, and that worked fine in the past. Maybe gdb 7.11[.1] has an issue with this?

------------
Btw, I have no idea why some are grey.
I would think either selection or focus?

Reply by email

Graeme Geldenhuys
to Martin Frb
Martin Frb wrote
Ok, thats a first, never seen that before.

I finally found the cause of the problem. I don’t use build modes in Lazarus, so only ever looked at the “Project Options -> Compiler Options -> Compilation and Linking” screen. That’s where I set the -O- option, and I also set other debugging options in the “Compiler Options -> Debugging” screen, like the -gl and -gh options.

What I didn’t realize was that inside “Compiler Options -> Additions and Overrides”, there was a “Stored in IDE” custom option (there are actually a few defined), and one of the active options was -O2. And that optimisation option is what caused all the trouble.

Lovely conflicting options with no warning. Personally I think the Compiler Options screens in Lazarus is a huge confusing mess. The IDE dialog designers should take some cues from MSEide’s Project Options dialog. In MSEide all build/make option are located in one place/screen with an instant overview of all build modes. What you see is what you get. No hidden settings from other screens.

Anyway. Thank you very much Martin for taking the time in trying to help me. I apologise for my heated messages from earlier. At that point I wasted so many hours, and were at boiling point for some time. That probably wasn’t the best time to write a message either.

Regards,
Graeme

Reply by email

Mattias Gaertner
to Graeme Geldenhuys
Show quoted text 13 lines
[...] I finally found the cause of the problem. I don’t use build modes in Lazarus, so only ever looked at the “Project Options -> Compiler Options -> Compilation and Linking” screen. That’s where I set the -O- option, and I also set other debugging options in the “Compiler Options -> Debugging” screen, like the -gl and -gh options. What I didn’t realize was that inside “Compiler Options -> Additions and Overrides”, there was a “Stored in IDE” custom option (there are actually a few defined), and one of the active options was -O2. And that optimisation option is what caused all the trouble. Lovely conflicting options with no warning.

The IDE now warns.
Note that they are not "conflicting". Overriding a flag is a common thing.

Mattias

Reply by email