[fpc-devel] New Windows gdb-binary

Joost van der Sluis joost at cnoc.nl
Fri Sep 30 17:22:50 CEST 2011


On Fri, 2011-09-30 at 15:54 +0100, Martin wrote:
> On 30/09/2011 15:45, Joost van der Sluis wrote:
> > On Fri, 2011-09-30 at 21:47 +0800, Paul Ishenin wrote:
> >> 30.09.2011 21:02, Joost van der Sluis wrote:
> >>> Hi all,
> >>>
> >>> For all those who are interested in new debug-features of fpc and gdb, I
> >>> have cross-compiled a gdb-executable for Windows.
> >>>
> >>> It's based on the Fedora-16 branch from the Archer project. But I added
> >>> a few patches of my own, namely the patch to recognize methods, setting
> >>> case-sensitivity off by default and a patch to allow evaluating
> >>> method-values (without actually calling them.)
> >> How can this be possible? Some internal virtual machine?
> > Huh? The compilation of the Fedora-gdb-sources for Windows? Fedora comes
> > with an out-of-the-box mingw cross-compiler. (Not really a vm)
> >
> 
> I think this was about:
> > evaluating
> > method-values (without actually calling them.)
> 
> which got me curious too.

It's nothing important. It's just a very small bug in gdb that got
fixed.

> Now reading it again, does it mean:
> 1) gdb can (magically?) get the return value of a function/method, but 
> WITHOUT calling/invoking the function (e.g. for properties)
> 2) gdb can "evaluate" the type of a method. e.g return "ptype 
> Tfoo.Method" = "function(a:int): boolean"

The second. When you do 'p functionname' you get some background
information about the function. When you do 'p functionname()' it will
call the function.
This didn't work for methods, so 'p class.methodname()' did work while
'p class.methodname' didn't. That's what's fixed.

The (simple) patch is attached.

But what we could do now is write debuginfo for properties with getters
as if it is a function. The answer of 'p class.propertyname' will tell
you it's a function, which yould be called if you want to.


Joost
-- 
My Lazarus blog: http://www.lazarussupport.com/lazarus/weblog
-------------- next part --------------
A non-text attachment was scrubbed...
Name: method.diff
Type: text/x-patch
Size: 373 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20110930/10332e0b/attachment.bin>


More information about the fpc-devel mailing list