[fpc-devel] Debugger for FPC

Martin Schreiber fpmse at bluewin.ch
Wed Mar 11 09:59:22 CET 2009


On Wednesday 11 March 2009 09:24:53 Graeme Geldenhuys wrote:

For me GDB with the MSEide frontend is better than the integrated debugger in 
Delphi 7. It is almost impossible to develop something like MSEide+MSEgui 
with writeln and logfile approach. Manytimes bugs are hard to find in event 
driven software without watchpoints.
GDB can switch the stackframe which Delphi 7 cant. The problem of the 
properties is not a big one because of the "f" naming convention, I don't 
like if gdb would call the getter functions because of possible sideeffects.
There are some issues with debuginfo of dynamic arrays in classes, if the FPC 
team is interested, I can try to build testcases to show the problems.

> Hi everybody,
>
[...]

>
> Simple things that worked in Delphi IDE and even Kylix IDE, but not in
> FPC/Lazarus IDE:
>
> * Breakpoints do not always break

I never seen this in MSEide.

> * Tooltip evaluation of highlighted code gives "no such symbol in
> context" errors

Same can happen in Delphi 7 for example in with statements.

> * Properties on objects cannot be debugged. You have to use the
> underlying field variable if you have access to it,

A small problem once you know it. :-)

> or you the 
> property uses access methods you are screwed.

Think on the possible sideeffects.

> * In most cases I cannot inspect local variables, due to "no such
> symbol in context" errors

This normally works for me.

> * debugging nested procedures are totally useless.
>
Switch the stackframe if you want to examine variables of a caller.

[...]
>
> Like I said, I am not very knowledgeable with debugger internals, but
> I am willing to learn and help. Not having decent debugger support is
> killing me - and I am clearly not alone, as the thread in the Lazarus
> mailing list proves. The problem as far as I can see, is that the Free
> Pascal project is trying to use existing debuggers that were NOT
> designed to work with the Object Pascal language. So maybe we should
> stop using those and implement our own debugging symbol format (if
> that is required) and then continue with writing a debugger specific
> to Free Pascal. I am more that willing to put in some effort if it
> means we end up with a working debugger!
>
Using gdb has the *big* advantage to have a working environment on many 
platforms with working remote debugging. I suspect the work for developping 
an own debugger will be very big, have a look into the gdb sources and you 
know what I mean...
The main problem with gdb is the communication by pipes and the not finished 
mi-interface, once the communication works and the workarounds for the 
missing mi-functions are done gdb is not bad.

Martin



More information about the fpc-devel mailing list