Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get rid of "quit anyway" prompt using GDB: Just kill the process and quit

Tags:

gdb

Consider:

(gdb) q A debugging session is active.          Inferior 1 [process 9018] will be killed.  Quit anyway? (y or n) y 

What is a .gdbinit option to make GDB always kill the running process at a quit request?

I know that GDB can attach to already-running processes, so it would be bad to kill them at quit. But for a processes started from it, a need to confirm your actions starts to annoy at a second quit.

like image 400
kagali-san Avatar asked Dec 04 '10 21:12

kagali-san


1 Answers

Turning confirmation prompts off globally disabled many other useful checks, such as the one to ask you if you really want to delete all breakpoints when you type "delete".

It would be better to disable the prompt only for the quit command. You can do that by adding this hook to your ~/.gdbinit (for current user) or /etc/gdb/gdbinit (for all users):

define hook-quit     set confirm off end 
like image 142
Eric Avatar answered Oct 20 '22 07:10

Eric