Reputation: 93
I always need to type:
handle SIGPIPE nostop noprint pass
Is there a way to make it permanent or to configure gdb to have it in its settings?
Upvotes: 7
Views: 10833
Reputation: 4751
Create a file ~/.gdbinit containing:
handle SIGPIPE nostop noprint pass
the contents of this file are just standard gdb commands, and are executed each time gdb is started.
It is also possible to have project specific .gdbinit files. Imagine your project directory is: /home/user/my-project/
and this is where you start gdb from when debugging your project. First add this line to your ~/.gdbinit:
add-auto-load-safe-path /home/user/my-project/.gdbinit
Then create a file /home/user/my-project/.gdbinit
place any gdb commands that are specific to this project into this new .gdbinit
file and they will be executed every time you start gdb in the project directory.
Upvotes: 9
Reputation: 9
GDB will run all commands in your ~/.gdbrc file each time it starts, so you can place that handle command in their to have it automatically executed each time you start gdb.
Upvotes: 0