Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

permanently disable gdb startup text

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) 
like image 676
user14189198 Avatar asked Dec 14 '25 12:12

user14189198


2 Answers

The patch alluded to by Tom Tromey above has been merged into gdb 11, it appears.

Put set startup-quietly on into an early initialization file (this is $XDG_CONFIG_HOME/gdb/gdbearlyinit, ~/.config/gdb/gdbearlyinit or ~/.gdbearlyinit) and you will be good.

See the documentation here: https://sourceware.org/gdb/onlinedocs/gdb/Initialization-Files.html#Initialization-Files

and here: https://sourceware.org/gdb/onlinedocs/gdb/Mode-Options.html#index-set-startup_002dquietly

like image 127
Yet Another User Avatar answered Dec 16 '25 22:12

Yet Another User


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.

like image 33
Tom Tromey Avatar answered Dec 16 '25 22:12

Tom Tromey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!