Fw: Xcode as debugger only? (mostly solved)
Fw: Xcode as debugger only? (mostly solved)
- Subject: Fw: Xcode as debugger only? (mostly solved)
- From: Xochitl Lunde <email@hidden>
- Date: Tue, 16 Jun 2009 14:19:44 -0500
----- Forwarded by Xochitl
Lunde/tripplite on 06/16/2009 01:29 PM -----
>
> > Create an empty project, create a Custom Executable, set it to
> > invoke your app, and point it at your sources. You can
launch and
> > run in the Xcode debugger, stop at breakpoints, etc.
> >
> > Chris _______________________________________________
First, thanks for the help! I have had some success
with this now. My app is not running as root yet, but here's some
additional info for anyone who might later be trying to debug an executable
produced from an automake build:
- Make new empty project, anywhere, easiest if it's
not in the source tree (otherwise when you add sources, Xcode might recursively
include its own project files).
- Add custom executable under Executables. When I
did this, I had to type the full path, including the executable name into
the path.
ex:
Name:
appd
Path:
/Users/me/code/svn/project1/branches/branch1/src/appd/.libs/appd
- If you have an automake build using shared libraries,
probably your application executable is stored in a ".libs" folder.
ex:
--------------------------------------
Makefile.am:
# This is Makefile.am
bin_PROGRAMS =
appd
appd_SOURCES =
appd.cpp
appd_LDFLAGS =
-L$(top_builddir)/src/depend -framework CoreFoundation
appd_LDADD = -ldepend
appd_CXXFLAGS
= -W -Wall -Werror --pedantic -02 -g -fno-strict-aliasing
INCLUDES = -I.
-I$(top_srcdir)/../depend/h
--------------------------------------
Now you have an
"appd" in /Users/me/code/svn/project1/branches/branch1/src/appd/
and /Users/me/code/svn/project1/branches/branch1/src/appd/.libs/
The appd in .libs
is the one you want. The appd in the other directory is a script
for setting up the shared libraries but I don't know too much about it.
- If I messed up the path to the executable and needed
to change it, I always had to close and reopen the Xcode project, otherwise
the debugger (shift+command+Y under the Run menu) would complain that the
Executable was not found even if the path was correct.
- Because Xcode isn't going to execute the script
to setup shared libraries, I had to install all the shared libraries on
the Mac. So if your automake is correct, use "make install" to
install the libraries. Mine ended up in /usr/local/lib. If
you don't do this, maybe you will see EXC_BAD_ACCESS in the GDB console
or just get a segmentation fault when debugging. (I had outdated libraries
installed at first, and that's what I got.)
- Add sources so you can make breakpoints and have
something to step through: In the project pane under Groups&Files there's
an icon with the name of the project. Right click and add Existing Files.
I picked the top level files of my source tree and set the Reference Type
to "Absolute" and chose "Recursively create groups for any
added folders." Now you should be OK to set breakpoints and whatever.
- Maybe you want to see the breakpoints in the Groups&Files
menu. "Run->Show->Breakpoints", and now the breakpoints
are there.
So, now I have the Xcode debugger setup using just
1 project. I did not have to make many projects in order to debug
into all my libraries. My app console output from Xcode is now exactly
the same as the console output when the app runs from the terminal. (The
console is easy to find: there's a button in the upper right part of the
Debug window.)
My Xcode version is 3.0 Component versions: Xcode
IDE 921.0, Xcode Core: 921.0, ToolSupport: 893.0
On the other hand, if you are still reading this email
thread, maybe what you are really looking for is this: http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/intro/intro.html
Xochitl
_______________________________________________
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