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?

willc2
  • 38,991
  • 25
  • 88
  • 99

3 Answers3

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.

Alex B
  • 82,554
  • 44
  • 203
  • 280
  • 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 01 '09 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.

sigjuice
  • 28,661
  • 12
  • 68
  • 93
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))

Community
  • 1
  • 1