Re: using Xcode only as debugger interface
Re: using Xcode only as debugger interface
- Subject: Re: using Xcode only as debugger interface
- From: Scott Tooker <email@hidden>
- Date: Fri, 8 Oct 2004 11:23:34 -0700
One addition is to use an 'External Target' to wrap your existing
makefile. This way you can actually initiate the builds from within
Xcode, but your external build system manages the build. In this case,
we should also do a fair job at parsing the build log output (assuming
you are using gcc).
Scott
On Sep 24, 2004, at 12:06 AM, Johannes Hoffstadt wrote:
Hi,
I'm sorry if this is a well-known topic to you, but as the archives
can't
be searched at the moment, and google didn't turn up with anything,
I thought I just post what I found. Comments are welcome...
I do multi-platform C++ development mainly with Makefiles and Qt.
I didn't really want to create a parallel XCode project when working
on the Mac, and keep it always in sync.
Not knowing better, I was left with command-line gdb for debugging.
Wouldn't it be nice to use XCode as interface for debugging an already
existing executable, but without maintaining a complete XCode project?
I just discovered how to do this with an almost empty project. Skip
the rest if that's old news to you...
Steps in XCode are:
1. File/New Project
- select template "Empty Project"
- give it some name like "xcdebug"
(which might become a recognisable habit)
- select your project directory and edit the path
to remove the "xcdebug" part
because you do not need a subdirectory
2. Project/New Custom Executable
- choose your existing binary executable or application bundle
- better change the name "Executable" to something meaningful,
e.g. the file name of your binary
- add more executables if you like (e.g. if your
directory/Makefile
contains multiple targets, you can have a single xcdebug
project
to quickly debug any of the binaries there)
3. In Groups&Files pane/Executables/your executable use Info button
(or command I)
- in tab "General", set your working directory
(e.g. to "Project directory" if you want to imitiate running
from
command-line)
- if you have an application bundle, edit the executable path
manually
by adding "/Contents/MacOS"; then press "Choose..." and select
the
binary (you do not get there in the former dialog, and the
debugger
really needs a file with the executable permission bit set,
even if
you can run gdb just with the .app in the terminal)
- in tab "Arguments" set your command-line arguments (obviously)
- in tab "Debugging" add directories for source files if needed
(you do *not* need to do that if you link your binary or
library with
relative paths to object files - then gdb will already know
where
the source files are)
4. Debug/Breakpoints
- press "New Breakpoint" and enter the symbol name "main" (or
another)
(otherwise debugging will run the application without breaking
anywhere, and since you do not see any source at this stage,
you
cannot interfere)
5. Debug/Debugger
- press "Debug", and there you go...
- note: if "Debug" is inactive, then it is likely that your
selected
executable is not, well, executable. For example, if you had
selected
an .app, you have to edit the executable path first (see 3.
above)
Sorry for the long post.
Hanno
_______________________________________________
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
_______________________________________________
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