Comments (3)
I can't see much against such a feature... it's as easy as a global variable that holds the possible callback, which gets fired before the exception is handled if it isn't NULL
and an exported function that allows to set it up.
I thought about suggesting it myself, so I could manually print an "program caught an exception, generating stack trace...." to the console when the program crashes (and the user is thus informed) but I didn't because such an output is better to be build into Dr. MinGW itself... (to reduce the overall binary size since the presence of exchndl
is optional in my case, so less code to set it up is always better)
The hard part is the question what such a callback should receive.. eg. nothing or actual crash information...
from drmingw.
I rather not maintain a complicated interface around ExcHndl.
What I could consider is exposing what's currently under src/common
to 3rd parties, as a debug engine (similar to https://msdn.microsoft.com/en-us/library/bb145126.aspx ).
If you look at https://github.com/jrfonseca/drmingw/blob/master/src/exchndl/exchndl.cpp you'll see that ExcHndl is nothing but a thin veil around the engine the code in src/common
. This is why I see little merit building a complex interface for ExcHndl.
Of course, src/common.cpp
is not ready for 3rd party. Step 0 would be clean the interface to be concise and generic, and step 1 would be to expose it as a DLL instead of static library.
from drmingw.
We'd also really like this feature for our project. We use ExcHndl to write crash dumps, but it would be very helpful, if we could include more information in the crash dumps like system/hardware information. We are currently limited by how much information we can put into the file name of the crash dump.
I propose the following additions to the ExcHndl interface (names subject to change):
EXTERN_C VOID APIENTRY
ExcHndlSetLogExtraDataA(const char *pszLogExtraData);
EXTERN_C VOID APIENTRY
ExcHndlSetLogExtraDataW(const WCHAR *pszLogExtraData);
This function (available as ANSI and Unicode variant) would simply set a string that will be additionally written at the end of crash dumps. This string can also contain line breaks. This would avoid issues introduced by using a function pointer like originally proposed. I think overall this is still a simple enough interface and a useful addition to ExcHndl as an embeddable exception handler.
I would write the implementation if you accept this feature.
from drmingw.
Related Issues (20)
- Faulting location incorrect if executable uses ASLR. HOT 3
- Have it handle stack corruption HOT 3
- No source code is showing for projects built with MSYS2 HOT 4
- Reason for erroring out with posix threads? HOT 2
- Can exchndl be made to catch RaiseFailFastException? HOT 4
- catchsegv not resolving gnu_debuglink correctly HOT 8
- catchsegv clobbers Unicode arguments
- Feature request: Support ARM64 HOT 23
- Feature request: Allow opt-in to use system provided zlib HOT 1
- ExcHndl.dll can't print the crash call stack under Windows 7 HOT 20
- Dumping register values on x86_64 HOT 1
- Write minidump from exchndl.dll
- Support minidump locations/filenames containing unicode (wide char) characters HOT 4
- Release 0.9.8: Naming of link libraries different between 32 and 64 bit HOT 3
- What is the minimal OS to run the official drmingw release? HOT 2
- libwinpthread-1.dll missing from release HOT 9
- Save the result automatically HOT 3
- Is it possible to update drmingw to the latest version in the msys2 package? HOT 2
- better sample code in the home page HOT 1
- exchndl problem HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drmingw.