Skip to content
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

"break into debugger" command line option doesn't work for unexpected exceptions #586

Closed
vadz opened this issue Feb 5, 2016 · 2 comments

Comments

@vadz
Copy link
Contributor

vadz commented Feb 5, 2016

It's unexpected that unexpected exceptions in the tests don't break into the debugger. It's also inconvenient as debugging them is more difficult because of this, especially if you have other exceptions which are expected and handled.

I think this should be changed and, as usual, would be ready to make a PR for this if you agree, please let me know if you do, TIA!

Just for the record, here is the minimal test allowing to reproduce this:

#define CATCH_CONFIG_MAIN
#include <catch.hpp>

TEST_CASE("exception") { throw "nobody expects the Spanish inquisition"; }

If you compile and run it under gdb:

% g++ tst.cpp && gdb --args ./a.out -b
Reading symbols from ./a.out...done.
(gdb) r
Starting program: /.../a.out -b

\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.out is a Catch v1.3.3 host application.
Run with -? for options

-------------------------------------------------------------------------------
exception
-------------------------------------------------------------------------------
tst.cpp:4
...............................................................................

tst.cpp:4: FAILED:
due to unexpected exception with message:
  nobody expects the Spanish inquisition

===============================================================================
test cases: 1 | 1 failed
assertions: 1 | 1 failed

[Inferior 1 (process 22104) exited with code 01]

the expected SIGTRAP doesn't happen.

@lorenzhs
Copy link

Have you seen #418?

@vadz
Copy link
Contributor Author

vadz commented Aug 25, 2016

No, sorry, I hadn't. I agree that it's the same thing and will close this one, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants