[Lazarus] debug hints in lazarus [Re: [fpc-devel] Status and ideas about debug info (stabs, dwarf / dwar3)]

Graeme Geldenhuys graemeg.lists at gmail.com
Tue Sep 13 20:17:23 CEST 2011


On 13 September 2011 16:26, Martin wrote:
>
> ShortDateFormat is declared in the RTL
> So you need an rtl with debug info.

I realized that as soon as I read Vincents reply. :-) But then, why
does it work in Delphi? I am using Delphi 7, and there is a separate
"DEBUG RTL" directory, which I am not using as far as I know. I'm not
in front of my work PC now, so I can't check the exact Environment
settings of Delphi, or the Delphi directory layout where the debug RTL
files are located.


> On my system, I can inspect it (including hint). But my rtl has debug info.

I'll recompile my RTL tomorrow, and see how that goes.


> So is much of the code I use. If properties do not modify the state of that
> app, or objects (and that is kind of vital to allow running getter

I guess my other problem is that I often have an application singleton
function that returns the application instance. It's a function that
returns a object instance - thus no debugging is supported by default.

Though experimenting with this a bit further, I noticed that I could
use the private application instance variable that the singleton
function uses, and that seems accessible to the debugger and allows
improved debugging. :-)

eg:  I need to change my debug expression from:

      gMyApplication.CurrentUser.Name

to

     uMyApplication.CurrentUser.Name


> I do not argue that there is a serious impact on COMFORT. there is an
> impact. no doubt.

Yes, field variable are hard to track down when you have 10+ hierarchy
levels, and sometimes there are no field variables at all, just a
getter function which are virtual or virtual abstact, and overridden
somewhere in the class hierarchy.


> can under no circumstances be debugged using gdb => I must say, I have a
> huge amount of respect for your archivment of implementing fpgui without
> using any debugging at all. WOW.  (scnr :)  )

I use tiOPF's tiLog unit for 95% of my debugging needs. I basically
limit GDB usage to breakpoints and single stepping. But I keep
monitoring the log output. tiOPF's log framework can log to file,
console, gui window (separate popup window, but built into the app) or
debug server (a separate gui app in fpGUI), so debugging works quite
well, contrary to what you might think. AND the output is always
readable, unlike the current state of Lazarus trunk.  ;-)


> I just say from my personal experience,  I can live without it, but that may
> just be me.

And I'm just saying that debugging is Delphi is so much less effort
than with FPC. In Delphi I can get on with my work, in Lazarus I have
to fight a debugger. But please don't take this the wrong way, I am
really glad to see all your hard work and efforts in trying to improve
debugging under Lazarus. It is definitely improving.


> maybe again that you have units without debug info (or you mix dwarf and
> stabs)?

I use only DWARF debug info. I believe this is the standard under
64-bit FPC anyway.


-- 
Regards,
  - Graeme -


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




More information about the Lazarus mailing list