摆脱“无论如何退出”提示使用GDB:杀死进程并退出 [英] Get rid of "quit anyway" prompt using GDB: Just kill the process and quit
问题描述
考虑:
(gdb)q
调试会话处于活动状态。
劣等1 [过程9018]将被杀死。
无论如何退出? (y或n)y
什么是 .gdbinit
选项让GDB总是在退出请求时终止正在运行的进程?
我知道GDB可以附加到已经运行的进程上,所以这会很糟糕在戒烟时杀死他们。但是对于从其开始的流程,需要确认您的操作会在第二次退出时开始恼人。
转动确认提示关闭全球禁用许多其他有用的检查,如问你是否真的要删除所有断点,当你键入删除。
这将更好仅对quit命令禁用提示。您可以通过将此挂钩添加到〜/ .gdbinit(对于当前用户)或/ etc / gdb / gdbinit(对于所有用户)来完成此操作:
define hook-quit
set confirm off
end
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.
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
这篇关于摆脱“无论如何退出”提示使用GDB:杀死进程并退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!