GDBINIT(5)
π GDBINIT(5) π
okay so real talk, bestie β this is the GDB initialization scripts page from the GNU Development Tools manual. sit down, grab a strawberry, and let me tell you about the little files that whisper to GDB before it even says hi to you πβ¨
β¨ SYNOPSIS β¨
/etc/cuda-gdb/gdbinit
/etc/cuda-gdb/gdbinit.d/*
~/.config/gdb/gdbinit
~/.gdbinit
./.gdbinit
that's it, that's the whole vibe check. five spots. slay π
πΈ DESCRIPTION πΈ
so these files? they're full of GDB commands that get to run automatically during GDB startup. no typing required, no cap. the lines inside them are canned sequences of commands, and the GDB manual explains all of that in node "Sequences" β you can peek at it with the shell command:
info -f gdb -n Sequences
please go read more in the GDB manual, node "Startup", via:
info -f gdb -n Startup
now let's go through each file one by one because they are not the same, and the way that people mix them up is honestly tragic π
π /etc/cuda-gdb/gdbinit
the system-wide initialization file, periodt. it gets executed unless the user specified the GDB option -nx or -n. more deets in the GDB manual, node "System-wide configuration", shell command:
info -f gdb -n 'System-wide configuration'
π¦ /etc/cuda-gdb/gdbinit.d
the system-wide initialization directory, and this one is giving group project energy β all files in this directory are executed on startup, unless the user specified the GDB option -nx or -n, and as long as they have a recognized file extension. yes, the extension matters, do not come for me. more in the GDB manual, node "System-wide configuration", shell command:
info -f gdb -n 'System-wide configuration'
π§ ~/.config/gdb/gdbinit or ~/.gdbinit
the user initialization file β this is your file, your main character moment π. it's executed unless the user specified the GDB options -nx, -n or -nh. three whole flags can silence it. respect.
β .gdbinit
the initialization file for the current directory. it might need to be enabled first with the GDB security command:
set auto-load local-gdbinit
heads up: it may need to be enabled β it's not just vibing there on its own automatically, ok?
more in the GDB manual, node "Init File in the Current Directory", shell command:
info -f gdb -n 'Init File in the Current Directory'
π OPTIONS π
...
and that's it. that's the section. the OPTIONS section on this page is literally empty β no flags listed here, nothing hiding, no secret menu. the options mentioned up in DESCRIPTION are GDB's own options, not options of this page. we move π«Ά
π SEE ALSO π
gdb(1)"info -f gdb -n Startup"
the full documentation for GDB lives as a Texinfo manual. if the "info" and "gdb" programs and GDB's Texinfo documentation are properly installed at your site, this command:
info gdb
should give you access to the complete manual. iconic.
also on the reading list: Using GDB: A Guide to the GNU Source-Level Debugger, by Richard M. Stallman and Roland H. Pesch, July 1991. vintage. timeless. ate.
π COPYRIGHT π
Copyright (c) 1988-2022 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Sections being "Free Software" and "Free Software Needs Free Documentation", with the Front-Cover Texts being "A GNU Manual," and with the Back-Cover Texts as in (a) below.
(a) The FSF's Back-Cover Text is: "You are free to copy and modify this GNU Manual. Buying copies from GNU Press supports the FSF in developing GNU and promoting software freedom."
and that's the whole page bestie!! π this was gdbinit(5) from gdb-12.1, dated 2024-04-01 β go forth, write your startup scripts, and remember: -nx, -n and -nh will absolutely ghost your init files if you let them πβ¨ bye ily ππ¦
π¦ where this page comes from
- ubuntu noble: nvidia-cuda-gdb 12.0.140~12.0.1-4build4 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms