November 07, 2005 Exception tweak (simple solution to stack trace and friends) | ||||
---|---|---|---|---|
| ||||
Walter, Here is a simple change I'd like to see to Exception: class Exception { + static void* function() exceptionHook = null; + void* hookData; } If the application sets the global exceptionHook this function is called in the context that generated the exception (ie. with the stack intact). The return value is attached to the Exception created. This would enable client implementation of stack tracing, crash dumps and similar features without burdening the language or compiler. Currently implementing crash recovery is brittle at best and impossibe at worst. Take care, Kai -- Kai Backman, programmer, kai@shorthike.com http://www.ShortHike.com - space station game |
November 07, 2005 Re: Exception tweak (simple solution to stack trace and friends) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kai Backman | On Mon, 7 Nov 2005 16:06:06 +0200, Kai Backman wrote: > called in the context that generated the exception (ie. with the > stack intact). Just to be a bit more precise. There can naturally be a constant number of additional stack frames on the stack (the exception processing routines) or alternatively the hook function can take an int parameter giving the number of extra frames. -- Kai Backman, programmer, kai@shorthike.com http://www.ShortHike.com - space station game |
Copyright © 1999-2021 by the D Language Foundation