Re: [fpc-pascal] console gdb in mac

2014-09-08 Thread Joost van der Sluis

On 09/07/2014 05:42 PM, Felipe Monteiro de Carvalho wrote:

On Sun, Sep 7, 2014 at 5:19 PM, Felipe Monteiro de Carvalho
 wrote:

I'm trying to debug lcl-cocoa, but the debugger in the IDE is not
helping (not stopping in breakpoints inside the LCL, can't read
variable names, etc...)


Well, I see now that IDE debugging generally works, but that reliably
it stops working inside this function:

function TCocoaWidgetSet.SetFocus(Handle: HWND): HWND;

Breakpoint inside it works, but stepping / viewing values / any other
action will crash gdb.


Well, it was when I was working on Lazarus's cocoa-widgetset that I 
decided to make my own debugger.


You can try that one. Only thing is that you have to sign your IDE. (Or 
fpd - the console version of the debugger), you have to use the Dwarf 
debug-format, and you have to run 'dsymutil' to create a .dSym-debug 
bundle for your application.


If you want I can help you with that.

regards,

Joost.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] console gdb in mac

2014-09-08 Thread Joost van der Sluis

On 09/07/2014 05:19 PM, Felipe Monteiro de Carvalho wrote:

Hello,

I'm trying to debug lcl-cocoa, but the debugger in the IDE is not
helping (not stopping in breakpoints inside the LCL, can't read
variable names, etc...)

So I moved to the console gdb, and I can already break, step over, etc.

But, how to read variable names? I guess a wierd mangling will be
involved here =)

In particular, let's say I am here:

procedure TControl.SetParent(NewParent: TWinControl);
begin
   if FParent = NewParent then exit; <<--- here

How can I read the value of field FParent which is located in object "Self" ?


That's not that difficult:

p this
p this.fparent

If it does not work, try 'THIS' and 'THIS.FPARENT'.

Joost.




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] console gdb in mac

2014-09-08 Thread Michael Ring
Joost, I saw some of your posts but did not know that your debugger has 
a console version. Is it possible to connect to a gdb-server with fpd?


Michael (not trying to hijack this thread)

Am 08.09.14 um 17:39 schrieb Joost van der Sluis:

On 09/07/2014 05:42 PM, Felipe Monteiro de Carvalho wrote:

On Sun, Sep 7, 2014 at 5:19 PM, Felipe Monteiro de Carvalho
 wrote:

I'm trying to debug lcl-cocoa, but the debugger in the IDE is not
helping (not stopping in breakpoints inside the LCL, can't read
variable names, etc...)


Well, I see now that IDE debugging generally works, but that reliably
it stops working inside this function:

function TCocoaWidgetSet.SetFocus(Handle: HWND): HWND;

Breakpoint inside it works, but stepping / viewing values / any other
action will crash gdb.


Well, it was when I was working on Lazarus's cocoa-widgetset that I 
decided to make my own debugger.


You can try that one. Only thing is that you have to sign your IDE. 
(Or fpd - the console version of the debugger), you have to use the 
Dwarf debug-format, and you have to run 'dsymutil' to create a 
.dSym-debug bundle for your application.


If you want I can help you with that.

regards,

Joost.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Unhandled Exception

2014-09-08 Thread Steve Gatenby

I have an intermittant exception in my Lazarus app (Access violation)
My app also uses a freepascal library - I think the problem is within it

Can anybody suggest the best way to narrow this down to a unit / 
function / line ?
I believe I have the Frame stack captured, but have no idea what to do 
with it


I have read the wiki on logging exceptions, but this seems to only give 
me address info, and I cant figure how to translate this to something useful


Thanks - SteveG
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Unhandled Exception

2014-09-08 Thread Dennis Poon



Steve Gatenby wrote:

I have an intermittant exception in my Lazarus app (Access violation)
My app also uses a freepascal library - I think the problem is within it

Can anybody suggest the best way to narrow this down to a unit / 
function / line ?
I believe I have the Frame stack captured, but have no idea what to do 
with it


I have read the wiki on logging exceptions, but this seems to only 
give me address info, and I cant figure how to translate this to 
something useful


Thanks - SteveG


May I ask whether you have tried enabling the debugger option?
  Project Options->Debugging->Generate Debug info for GDB
and then run the app within Lazarus.
When the AV occurs, it shall stop within lazarus and you can then go to 
View->Debug Windows->Call Stacks to see where the AV occur.


Dennis
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Unhandled Exception

2014-09-08 Thread Steve Gatenby

On 09/09/14 11:44, Dennis Poon wrote:



Steve Gatenby wrote:

I have an intermittant exception in my Lazarus app (Access violation)
My app also uses a freepascal library - I think the problem is within it

Can anybody suggest the best way to narrow this down to a unit / 
function / line ?
I believe I have the Frame stack captured, but have no idea what to 
do with it


I have read the wiki on logging exceptions, but this seems to only 
give me address info, and I cant figure how to translate this to 
something useful


Thanks - SteveG


May I ask whether you have tried enabling the debugger option?
  Project Options->Debugging->Generate Debug info for GDB
and then run the app within Lazarus.
When the AV occurs, it shall stop within lazarus and you can then go 
to View->Debug Windows->Call Stacks to see where the AV occur.


Dennis


I do have it enabled, but haven't been able to catch it on my 
development machine

(seems to happen mainly on the older production machines using our app)

I am hoping to include code within our app to collect enough info to 
enable me to backtrace it somehow.
Do you know if it is possible to gather information at the failure point 
(global exception handler) of a production system, and then input this 
to gdb (possibly on another machine) ?


Thanks for your thoughts




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal