Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
每次打开 GDB 时,我都会设置几个选项,例如:
set print thread-events off
有没有办法默认设置这些选项,可能是 .gdb_rc 文件?
的初始化文件gdb称为.gdbinit. 您可以将所需的选项放在此文件中。它们将在 gdb 启动期间自动执行。
gdb
.gdbinit
示例内容:
# set command line argument to "2" set args 2
您可以将.gdbinit文件放入您的 $HOME 或当前目录。后者覆盖全局$HOME/.gdbinit文件中的设置。
$HOME/.gdbinit