permanently disable gdb startup text

Viewed 699

When debugging a program with gdb (gdb main), it shows a lot of credits, and links. I know that we can use the quiet argument to disable this text, but I want to disable it permanently. Does gdb have init file or anything else in order to change the behavior of gdb?

Instead of:

$ gdb main
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
...

I want:

$ gdb main
Reading symbols from main...
(No debugging symbols found in main)
(gdb) 
2 Answers

At present, the only way to do this is to use gdb -q (aka gdb --quiet). This will silence the startup message. A typical way to do this is to use a shell alias.

There's a pending patch to add this feature to gdb. However, it won't be available until at least GDB 11, expected sometime next year.

Related