Re: Xcode won't debug!
Re: Xcode won't debug!
- Subject: Re: Xcode won't debug!
- From: Jamie <email@hidden>
- Date: Fri, 6 Aug 2004 21:59:51 +0100
On 6 Aug 2004, at 21:50, Jim Ingham wrote:
Jamie,
On Aug 6, 2004, at 1:39 PM, Jamie wrote:
Hi there.
First thing to say is that made a very silly [newbie] error and was
trying to debug using a deployment style build so the issue is
solved. However, since you seem to know a fair bit about this stuff
could I was wondering if you might have time to tell me a couple more
things?
No prob...
Firstly, I am interested to know how I can plug in gdb on the command
line. I take it all you have to do is compile with the debugging
symbols in (another question you probably don't want to answer is
what are debugging symbols!?) and then somehow hook the debugger onto
the app when it is running. Any clues or perhaps just a pointer to a
web page that might tell me more would be of help. I know this isn't
really Xcode stuff, but it's educational for someone learning C.
It's generally better to continue asking on the list, since then other
people learn as well (don't worry if they seem naive, many are shy of
asking questions, but really appreciate the answer if someone else
asks them :-)
To run gdb on your app, you need to know where your build products
are. Then do:
$ gdb <Build directory>/MyApp.app
at this point, you can either run from gdb, with the "run" command.
Or if it is already running, find its PID (for instance using the
Activity Monitor, or by doing "ps" in the terminal. And then do:
(gdb) attach <PID>
Actually, gdb can do some of this for you, if you do:
(gdb) attach MyApp<TAB>
gdb will fill in the PID for you (or list them if there is more than
one copy of the app running.
There is good documentation on the gdb commands in:
file:///Developer/ADC Reference Library/documentation/
DeveloperTools/gdb/gdb/gdb_toc.html
Great stuff. I'll have a play with that sometime. I'm mainly
interested as I quite often try porting unix stuff and have had
occasions when a debugger would have been handy - obviously making an
Xcode project can be a bit too much work and somewhat over the top.
The other thing that interests me is how you use a crash report
generated by crash reporter? Don't worry if you dont have the time
to answer these questions for me but any pointers would be very much
appreciated.
Dunno what you mean here? It shows some small sketch of the program
when it crashed. Sometimes that can tell you what it was doing. It
also tells you the addresses that all the shared libraries & plugins
actually loaded, which can help you match up addresses in the
backtraces with the code (but this is a longer topic that I don't have
the time to go into right now.)
Did you mean more than this?
No, not really. Was just wondering if there was some hidden magic I
was missing in interpreting these files. I kinda thought maybe there
was some utility you could plug them into to get some more useful
representation out of them. Guess not.
Thanks very much for taking the time to answer those questions. I
greatly appreciate it.
Jamie
Jim
Many thanks for your time.
Jamie
On 6 Aug 2004, at 21:31, Jim Ingham wrote:
Jamie,
I am guessing from the fact that you mention NSLogging that this is
a C/C++ based application of some sort. If it is then the easiest
way for us to tell what is going on is to see the log of
communication between Xcode and the underlying debugger (gdb). To
get that,
1) Quit Xcode.
2) In Terminal, say:
$ defaults write com.apple.Xcode PBXGDBDebuggerLogToFile YES
$ defaults write com.apple.Xcode PBXGDBDebuggerLogFileName
/tmp/IncludeInBug.log
3) Restart Xcode, and do whatever you need to to make it fail.
4) Then look in /tmp/IncludeInBug.log - that contains the transcript
of the gdb/Xcode communications.
These can be long, so don't send it out to the whole list. Just
send it to me, or better yet, file a Radar with the Bug Reporter,
and attach the log to the bug.
That will tell us how far gdb got in launching your program, and if
there were any errors, where they were. If there is no such file,
then Xcode didn't even try to start up the debugger.
If that is the case, make sure that target is actually trying to use
gdb as the debugger. In 1.5 this is set in the inspector for the
Executable you are running, under the Debugging Tab. Make sure it
is set to using gdb as the debugger.
Thanks,
Jim
On Aug 6, 2004, at 11:04 AM, Jamie wrote:
Hi there.
This is my first post to this list so hello all. I have a little
(or large) problem with Xcode that I can't sort out and I don't
know where to start looking.
Basically I have been working on a project for sometime and it has
suddenly stopped letting me use the debugger. This has been the
case for some days now, but now it is really starting to annoy me.
It goes through the motions of putting the debugger on the screen
and it doesn't log to the log window, but it doesn't actually
debug anything! I have no idea where to look to solve this. Is
this just some sort of corruption in the project file?
I have had the same thing happen to me on an AppleScript studio
project I worked on and it is extremely annoying. I have had to
revert to NSLogging all over the shop in this case simply to tell
what is going on in my code. FYI - This is the case on Xcode 1.2
and 1.5.
Any ideas greatly appreciated.
Jamie
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.