-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not break into gdb debugger when facing unexpected exception #1030
Comments
So far, breaking into debugger happens only for failed assertions. This means that this #define CATCH_CONFIG_MAIN
#include "catch.hpp"
int throws() {
throw 1;
return 1;
}
TEST_CASE("A") {
REQUIRE(throws() == 2);
} will break on the exception*, but your original code won't. Looking over #586, it is a separate issue from the one closed by me, but since it was closed by its creator back in 2016, I never even noticed it existing. I'll take a look at what it would take to implement this for unexpected exceptions outside of assertions, but the usual caveat emptor applies: the backlog of potential features is much bigger than the amount of available time. * Actually on the assertion failure |
@hiiwave does this conclude this issue for you? |
I would say it's still preferable if breaking into debugger |
I would love to use this feature as well. Unfortunately, Catch2 does not break with |
A current work-around with gdb can be to set breakpoints on all
|
That's a bummer. I'm on VS2013 and I'd love to be able to break on exceptions. I've got a std::out_of_range that I'd love to be able to break on. |
I'm currently on VS2019 - would also love to have this as an option. |
I'd also like to see this. Otherwise it's unnecessarily difficult to unexpected exceptions. |
I will be changing testing frameworks because of this. It makes it unnecessarily very difficult to debug unexpected exceptions. |
Is there any chance to see this feature implemented in a future version of Catch2? I've been hitting this limitation a couple of times, and it would really help debugging for sure. |
how is this still not a thing? very disappointing |
any update? |
Surprising this has been ignored for so long. I'd like to point out that there is a better way around this than just having to go through all exceptions. (gdb) catch throw
Catchpoint 1 (throw)
(gdb) ignore 1 1000
Will ignore next 1000 crossings of breakpoint 1.
(gdb) r
[...] Crashes
(gdb) info b
Num Type Disp Enb Address What
1 catchpoint keep y exception throw
catchpoint already hit 49 times
ignore next 951 hits
(gdb) # Ignore N-1 crossings of the catchpoint (N=49 above)
(gdb) ignore 1 48
Will ignore next 48 crossings of breakpoint 1.
(gdb) # Run again!
(gdb) r
[...] gdb will stop at the point the exception that terminates the test is thrown. |
Description
It's in fact the same issue as #586, where unexpected exceptions in the tests don't break into the gdb debugger with arguments
-b --break
. According to @horenmar at #418, it should have been implemented in commits b634e59, 25d0177, e1c4a4b. However it still does not work as expected.Steps to reproduce
Follow the same steps in #586, the test reproducing this is as follows:
By compiling and running it under gdb:
the expected
SIGTRAP
doesn't happen.Extra information
master
)The text was updated successfully, but these errors were encountered: