Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify silent/quiet in .gdbinit

Tags:

You can run gdb without printing the front material, which describes gdb's non-warranty, by specifying --silent (or -q/--quiet):

Is there an option in .gdbinit to do the same as gdb -q?

I do not mind seeing important warranty stuff, but not each time I start gdb. I know I can use alias, but I am curious about the config file.

https://sourceware.org/gdb/download/onlinedocs/gdb/index.html

I looked into website documentation, read the man page, but cannot see if that is possible.

like image 556
exebook Avatar asked Dec 10 '15 10:12

exebook


2 Answers

I was curious about this, so I looked at the source. There is no way to do it.

First, this relies on a local variable in the argument parsing function (captured_main). Second, the message is printed before ~/.gdbinit is read.

Aside from an alias (as you mentioned), the only other way to do this would be to modify gdb.

like image 178
Tom Tromey Avatar answered Sep 20 '22 13:09

Tom Tromey


only way to keep your sanity if you are starting gdb a dozen times in a row is:

alias gdb='gdb -q'

like image 27
gcb Avatar answered Sep 22 '22 13:09

gcb