在MinGW上的GDB中,如何使Ctrl-C停止程序? [英] In GDB on MinGW, how do I make Ctrl-C stop the program?

查看:264
本文介绍了在MinGW上的GDB中,如何使Ctrl-C停止程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows上,在MinGW下构建的可执行文件上运行GDB.该程序有一个无限循环.我想通过按 Ctrl + C 来找到它.当我这样做时,程序和GDB均退出.关于该主题的所有帮助似乎都假设我在Linux上.

I'm on Windows, running GDB on an executable built under MinGW. The program has an infinite loop. I want to find it by hitting Ctrl + C. When I do, both the program and GDB exit. All the help on this subject seems to assume I'm on Linux.

推荐答案

这是因为GDB无法处理GUI的 Ctrl + C 事件(非控制台)程序.

This is because GDB doesn't handle the Ctrl + C event of the GUI (non-console) program properly.

您可以在 GDB Ctrl-C中断的解决方法中找到解决方法 .

You can find the workaround in Workaround for GDB Ctrl-C Interrupt.

这篇关于在MinGW上的GDB中,如何使Ctrl-C停止程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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