[fpc-devel] FPC debug information
    dmitry boyarintsev 
    skalogryz.lists at gmail.com
       
    Wed Nov  5 08:31:12 CET 2008
    
    
  
another question about debug information:
while debugging with gdb, i have found that object methods are 'mapped' to
the debugger (or debug information?) as functions with additional parameter
'self' (what they actually are),
so let's say, i have an object m: TMyObject with method procedure MyMethod;
while gdb, does not understand the syntax, m.MyMethod, method still can be
called with TMYOBJECT_MYMETHOD(m) call.
can name collission to happen? if i also have function in the code, named
like procedure TMyObject_MyMethod(a: TMyObject), so it's name would match
(?) for the debugger with MyMethod ?
I hope my question is clear :)
------ Here's the code
type
  TMyObject = class
  public
  procedure MyMethod;
  end;
procedure TMyObject.MyMethod;
begin
  writeln('My method object');
end;
procedure TMyObject_MyMethod(m: TMyObject);
begin
  writeln(m.ClassName);
end;
procedure TMyObject__MyMethod(m: TMyObject);
begin
  writeln(m.ClassName, ' **');
end;
var
  m : TMyObject;
begin
  m := TMyObject.Create;
  m.MyMethod;
  TMyObject_MyMethod(m);
  m.Free;
end.
------ Here's the debugger output
(gdb) info functions
All defined functions:
File main6.pas:
void PASCALMAIN(void);
void TMYOBJECT_MYMETHOD(TMYOBJECT);
void TMYOBJECT__MYMETHOD(TMYOBJECT);  // TMyObject method?
void TMYOBJECT__MYMETHOD(TMYOBJECT);  // TMyObject method?
------
is there anyway for debugger to understand which of the procedures is
actually TMyObject method?
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20081105/c580fccd/attachment.html>
    
    
More information about the fpc-devel
mailing list