简体   繁体   English

Eclipse-CDT:如何配置调试器以停止异常?

[英]Eclipse-CDT: How do I configure the debugger to stop on an exception?

This might be a GDB question.. but I'd like to run my app in the debugger and have the debugger break when an exception is thrown, so I can see where the code is and what its doing at that time. 这可能是一个GDB问题..但是我想在调试器中运行我的应用程序,并在抛出异常时让调试器中断,这样我就可以看到代码在哪里以及它在那时做了什么。

I do this often in Visual Studio using the Debug -> Exceptions dialog, checking the 'Thrown' column beside the type of exceptions I'd like to stop on. 我经常在Visual Studio中使用Debug - > Exceptions对话框执行此操作,检查我想要停止的异常类型旁边的“Thrown”列。

  • Alex 亚历克斯

You can get the equivalent of gdb catchpoints in eclipse by: 您可以通过以下方式在eclipse中获得相当于gdb的catchpoint:

From breakpoints view, invoke action(small triangle pointing downwards near the maximize button) -> Add Event Breakpoint (C/C++) -> Exception Thrown. 从断点视图,调用操作(在最大化按钮附近向下指向的小三角形) - >添加事件断点(C / C ++) - >抛出异常。

The best I found is news.eclipse.tools.cdt: Re: Catching C++ exceptions at point of throw : 我找到的最好的是news.eclipse.tools.cdt:Re:在抛出时捕获C ++异常

Meanwhile, you can go at the GDB console in eclipse and type "catch throw", like you are did with gdb, 'til we find away to integrate this feature in CDT. 同时,您可以在eclipse中使用GDB控制台并输入“catch throw”,就像您使用gdb一样,直到我们找到将此功能集成到CDT中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM