-
Notifications
You must be signed in to change notification settings - Fork 239
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
Abort in OGS_FATAL() #1432
Abort in OGS_FATAL() #1432
Conversation
@@ -10,15 +10,30 @@ | |||
#ifndef BASELIB_ERROR_H | |||
#define BASELIB_ERROR_H | |||
|
|||
#ifdef OGS_FATAL_ABORT | |||
#include <cstdlib> | |||
#endif | |||
#include <stdexcept> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the exceptions are no longer needed in the case of OGS_FATAL_ABORT...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corrected
Why is it not possible to set a breakpoint to the line where the exception is thrown? Then backtracing is possible, isn't it? |
@TomFischer of course it's possible, but is inconvenient and inefficient for me. i'm using QtCreator and would like to see backtrack immediately whenever an error occur during debugging, without restarting with a breakpoint, or without modifying gdb config. |
Thanks for the explanation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@norihiro-w Just a minor notice: GDB with QtCreator can stop at any throw. You only need to add one special breakpoint for that, and if you don't remove that break point there is no need to restart in order to debug. |
OpenGeoSys development has been moved to GitLab. |
This PR adds a new CMake option
OGS_FATAL_ABORT
which enables callingabort()
inOGS_FATAL()
instead of throwing exceptions. The changes is helpful in debugging because it stops at at abort() and can backtrace from there.