Code Monkey home page Code Monkey logo

Comments (3)

White-Tiger avatar White-Tiger commented on June 1, 2024

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.

jrfonseca avatar jrfonseca commented on June 1, 2024

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.

Robyt3 avatar Robyt3 commented on June 1, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.