摆脱“无论如何退出”提示使用GDB:杀死进程并退出 [英] Get rid of "quit anyway" prompt using GDB: Just kill the process and quit

查看:614
本文介绍了摆脱“无论如何退出”提示使用GDB:杀死进程并退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑:

 (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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆