7

I'm new to XCode 3.1.2 and Objective-C 2.0. I've just discovered using breakpoints for logging instead of littering the code with millions of NSLog() statements. The problem is, when the debugger starts up it spews half a screen full of status and credits info into the console.

Is there any way to suppress this text?

3 Answers 3

6

XCode debugger is a front end to GDB. If Xcode lets you customize command line for GDB startup, use "-quiet" option.

If it does not, you can "customize" it with a not-so-pretty hack: move gdb executable to another file, and replace it with a shell script that will call the executable with "-quiet" option.

1
  • 1
    This sort jiggery-pokery would be a last resort. I worry that n months from now an update would break it after I'd forgotten what I did.
    – willc2
    Apr 1, 2009 at 21:46
1

On Mac OS X, /usr/bin/gdb happens to be a shell script. Simply replace the two lines at the end of this file that look like

exec $translate_binary "$gdb" ...

with

exec $translate_binary "$gdb" -q ...

Modifying system files like this is probably not a very good idea, but it looks harmless enough to me.

I spoke too soon. I just tried this out and looks like Xcode invokes the gdb binary directly (/Developer/usr/libexec/gdb/gdb-powerpc-apple-darwin on my system). So Checkers' original suggestion is the way to go.

1
  • If there is genuinely no "safe" way to do it I would just as soon skip it.
    – willc2
    Apr 1, 2009 at 21:49
0

You may crete your own gdb wrapper, according to tip from this question: How to specify which GDB I can use in XCode on MacOS

Something along these lines:

#!/bin/sh
echo "Wrapped GDB executed with $@"
gdb -quiet "$@"

Into /usr/local/bin/mygdb with:

defaults write com.apple.Xcode PBXGDBPath /usr/local/bin/mygdb

But -quiet parameter is ignored on my 10.6.4 system anyway (XCode 3.2.3, GNU gdb 6.3.50-20050815 (Apple version gdb-1463) (Fri Mar 5 14:24:01 UTC 2010))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.