Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn off startup text of GNU gdb in XCode

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?

like image 253
willc2 Avatar asked Mar 20 '09 01:03

willc2


2 Answers

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.

like image 164
Alex B Avatar answered Nov 15 '22 09:11

Alex B


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.

like image 43
sigjuice Avatar answered Nov 15 '22 10:11

sigjuice