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

Abort in OGS_FATAL() #1432

Merged
merged 3 commits into from
Sep 26, 2016
Merged

Abort in OGS_FATAL() #1432

merged 3 commits into from
Sep 26, 2016

Conversation

norihiro-w
Copy link
Collaborator

This PR adds a new CMake option OGS_FATAL_ABORT which enables calling abort() in OGS_FATAL() instead of throwing exceptions. The changes is helpful in debugging because it stops at at abort() and can backtrace from there.

@@ -10,15 +10,30 @@
#ifndef BASELIB_ERROR_H
#define BASELIB_ERROR_H

#ifdef OGS_FATAL_ABORT
#include <cstdlib>
#endif
#include <stdexcept>
Copy link
Member

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...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corrected

@TomFischer
Copy link
Member

Why is it not possible to set a breakpoint to the line where the exception is thrown? Then backtracing is possible, isn't it?

@norihiro-w
Copy link
Collaborator Author

@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.

@TomFischer
Copy link
Member

Thanks for the explanation.

Copy link
Member

@TomFischer TomFischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@norihiro-w norihiro-w merged commit f1fea43 into ufz:master Sep 26, 2016
@norihiro-w norihiro-w deleted the fatal-abort branch September 26, 2016 05:41
@chleh
Copy link
Collaborator

chleh commented Sep 26, 2016

@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.

@ogsbot
Copy link
Member

ogsbot commented Jun 19, 2020

OpenGeoSys development has been moved to GitLab.

See this pull request on GitLab.

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

Successfully merging this pull request may close these issues.

5 participants