[fpc-devel] Calling methods from within gdb

Joost van der Sluis joost at cnoc.nl
Mon Sep 12 22:05:57 CEST 2011


Hi all,

Does someone knows a trick how to make gdb call a method (function) from
a class?

When I have this class defined, compiled with dwarf2: (-gw3 gives an IE,
I'll have a look at that too)

type
  TMyClass = class
  public
    function Read: integer;
  end;

ptype returns:
(gdb) ptype aclass
type = ^TMYCLASS = class : public TOBJECT 
  public
    function  READ () : LONGINT;
end

Which seems ok to me, but something like print or call gives:
(gdb) call aclass^.READ()
Type TMYCLASS = class  has no component named READ().

Is there some syntactical trick that makes this work, or do I have to
debug gdb again?

-- 
My Lazarus blog: http://www.lazarussupport.com/lazarus/weblog




More information about the fpc-devel mailing list