tags:

views:

23

answers:

2

I have a program and want to debug it in gdb.

Will I see usual program output? How can I enable/disable this output, leaving only gdb messages.

+1  A: 

Yes, you will see all output from your program.

You can disable this by sending it off elsewhere. For example:

(gdb) run > /dev/null
Thomas
+1  A: 

You can redirect output from within gdb:

(gdb) run > somefile.txt

will redirect standard output to somefile.txt. You can also specify a terminal to send output to:

(gdb) tty /dev/ttyb
anon