Re: FreePascal unit in Cocoa project - debugger problems
Re: FreePascal unit in Cocoa project - debugger problems
- Subject: Re: FreePascal unit in Cocoa project - debugger problems
- From: Jonas Maebe <email@hidden>
- Date: Tue, 7 Jul 2009 13:22:12 +0200
On 07 Jul 2009, at 11:14, Alexander Bokovikov wrote:
On 25 Feb 2009, at 10:56, Jonas Maebe wrote:
I've now created a version of Apple's Currency Converter
sample (converted back to Objective-C 1.0) that calls a Pascal
function to perform the currency conversion multiplication.
You can download it from
http://users.elis.ugent.be/~jmaebe/fpc/FPC_Objective-C_Cocoa.tbz
Now I've tried to create something more or less real on this base.
The first problem I've run into is the debugger misfunctioning.
First I've noticed that all breakpoints in pascal module are
inactive. I opened XCode Preferences => Debugging and disable "Load
Symbols Lazily" option. click Build&Run again and see my breakpoint
being active, but... please take a look at screenshot attached. Real
break is shown in a very strange area outside of source code. At the
same time disassembler view shows break at pascal initialization
module. What is it all??? Can't I use debugger in pascal part of the
project? That would be very bad if not fatal... Any ideas?
Does it work with the sample project? (i.e., if you set a breakpoint
on line 41 of PascalLibrary.pas, in the PascalConvert function) I've
just tried that, and it works fine for me. Also, make sure that the
project's "Debug Information Format" setting is set to "DWARF with
dSYM File" (and that if you have multiple targets, that it's not set
to something different for any of them, because that will override the
project settings).
In general, the Xcode debugger works fine for single stepping Pascal
code and for basic variable viewing. What will not work are
a) using any kind of special variable/memory viewer while stepping
through Pascal code, because Xcode sends all commands in C syntax to
gdb (and gdb obviously does not understand C expressions when in
Pascal mode)
b) viewing Pascal strings (shortstrings). Plain gdb supports Pascal
shortstrings, but Xcode's debugger somehow overrides this support and
all shows such strings as an array of characters for some reason
c) calling subroutines from the debugger. The reason is that FPC by
default uses the Borland fastcall calling convention (for Delphi
compatibility), and that one is not yet supported by gdb.
d) viewing class properties, dynamic arrays and widestrings (and
probably some other language features I'm currently forgetting). These
require either DWARF3 features (which current released gdb versions do
not yet support), fixes in gdb's Pascal expression printer, and/or
fixes in the debug information generated by FPC
Jonas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden