Xojo Conferences

Re: Debugging plugins in Xcode ... 2.1 (Real Studio Plugins Mailinglist archive)

Back to the thread list
Previous thread: RB 2005 won't compile projects using my plugins
Next thread: AppleScript on CodeWarrior

Re: Debugging plugins in Xcode ... 2.1   -   Peter K. Stys

Re: Debugging plugins in Xcode ... 2.1
Date: 13.06.05 18:03 (Mon, 13 Jun 2005 13:03:31 -0400)
From: Peter K. Stys
I tried James' suggestion (actually from #8 onwards; I wrote my
plugin in Xcode 2.1 which has a single fn called add5, which works
fine, wrote a small RB app and added it as the New Executable in the
Xcode project, then did #10 below).

When I typed (gdb) break add5:

I got:

Function "add5" not defined.
Breakpoint 2 (add5) pending.

I set a breakpoint and ran my app, the execution did not stop at any

Has anyone succeeded in debugging a Mach-O plugin with Xcode 2.1?


On 9-May-05, at 4:16 AM, James Milne wrote:

> On 7 May 2005, at 23:23, James Milne wrote:
>> We can't debug plugins written in Xcode yet, AFAIK. I've just
>> installed all the latest Xcode 2.0 tools on my Powerbook, so I'm
>> going to see if the latest GDB can handle the Mach-O binaries
>> REALbasic generates.
> I can now confirm that plugins written in Xcode can be debugged in
> the Xcode IDE! :-) The latest GDB is happy with the Mach-O binaries
> that REALbasic 5.5.x produces (I'm testing with 5.5.4).
> Here are the steps to plugin debugging:
> 1) Grab the latest Plugin SDK, and install the Xcode REALbasic
> Plugin template.
> 2) Create a new project in Xcode using the REALbasic Plugin template
> 3) Implement your plugin
> 4) Write a little command line program in REALbasic that
> automatically builds your .dylib into a plugin RBX file. Execute
> this tool from Xcode by adding it as a Shell Script Build Phase to
> your target.
> 5) Build your plugin
> 6) Install your plugin in REALbasic Plugins folder.
> 7) Create a little shell project which runs uses your plugin, and
> build it as a Mach-O executable.
> 8) Go back to Xcode, and add a New Custom Executable to your
> project. In the dialog that appears, select the test app you
> compiled with REALbasic as the executable.
> 9) Double click on this new executable to bring up its properties
> window. Go to the Debugging tab, and __uncheck__ "Start executable
> after starting debugger"
> 10) To debug your plugin, simply go to the Debug menu and select
> Debug Executable. This should fire up your test app that you wrote
> with REALbasic. In the Debugger window, click on Console. A GDB
> console window will appear. To set some breakpoints, type "break
> <name of function>" into the console. Once you have set some
> breakpoints, type "run", and your test application will start up.
> When GDB sees your plugin dylib being loaded, it will resolve any
> breakpoints you set before you asked GDB to run the app. If GDB
> hits any of these breakpoints, it will enter back into the Xcode
> debugger, where you can see the source of the code the debugger has
> stopped at, and you can single-step through the code, read local
> variables, etc.

Peter K. Stys, MD
Professor of Medicine(Neurology), Senior Scientist
Ottawa Health Research Institute, Div. of Neuroscience
Ottawa Hospital / University of Ottawa
Ontario, CANADA
tel: (613)761-5444
fax: (613)761-5330

Unsubscribe or switch delivery mode:

Search the archives of this list here: