RE: [GD-Linux] signals and exceptions
Brought to you by:
vexxed72
From: Daniel V. <vo...@ep...> - 2001-11-16 00:12:15
|
Okay, here's the Windows define for our "guard" code. #define guard(func) \ {static const TCHAR __FUNC_NAME__[]=TEXT(#func); try{ #define unguard \ }catch(TCHAR*Err){throw Err;}catch(...){appUnwindf(TEXT("%s"),__FUNC_NAME__); throw;}} #define unguardf(msg) \ }catch(TCHAR*Err){throw Err;} \ catch(...){appUnwindf(TEXT("%s"),__FUNC_NAME__); appUnwindf msg; throw;}} and here is a sample function that uses it. void SomeFunction() { guard(SomeFunction); INT SomeVariable = 0; // Do something with SomeVariable unguardf(( TEXT("SomeVariable = %i"), SomeVariable )); } So you can get all sorts of extra information and text messages with this approach which is nice as it is part of release builds and you therefore get very precise crash reports from artists. This is a powerful tool if you hook it up to a bug tracking system though sometimes it can lead to very confusing (for non programmers) bug reports :) http://www.shacknews.com/screens.x/iotd//9/thumbs/deuserror.jpg - Daniel Vogel, Programmer, Epic Games Inc. > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...]On Behalf Of D. > Stimits > Sent: Thursday, November 15, 2001 6:53 PM > Cc: gam...@li... > Subject: Re: [GD-Linux] signals and exceptions > > > Daniel Vogel wrote: > > > > > Shouldn't you be able to do this from a signal handler as > well? I do that, > > > although very simplistic. It adds a few extra stackframes, > but those can > > > be ignored. > > > > We already have all this "nice" code doing this and printing > out extended > > backtraces (together with extra information we put on the > stack) that relies > > on unwinding the stack and I thought I could easily get that to work on > > Linux without our current setjmp/ longjmp approach. > > I am curious what kind of extra information you were dumping, aside from > stack frame and arguments? And what means you were using to track these > extra items (beyond function names)? > > D. Stimits, st...@id... > > > > > Mind sharing your code? I guess I'm just a bit too confused now to see > > obvious solutions :) > > > > - Daniel Vogel, Programmer, Epic Games Inc. > > > > _______________________________________________ > > Gamedevlists-linux mailing list > > Gam...@li... > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-linux > > _______________________________________________ > Gamedevlists-linux mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-linux > |