Help: Unwinding the C++ stack...throw, longjmp & threads
Jamie Lokier
jamie.lokier@cern.ch
Wed Aug 25 06:29:00 GMT 1999
Jason Merrill wrote:
> .eh_frame has nothing to do with how many handlers a function has; it tells
> the unwinder how to reload the registers saved in the function prologue so
> that they have the right values when we get to a handler in the caller.
Thanks, I'd completely missed that.
> Another possiblity would be to declare that all registers are clobbered on
> entry to an exception handler; then the default unwinder would only have to
> worry about how to find the return address and saved stack pointer for a
> frame, which is usually straightforward if you have a frame pointer to work
> with.
For functions without exception handlers (including all current C), that
would reduce .eh_frame while leaving the code the same.
For functions with exception handlers, it would mean slightly code in
the non-exception case.
Q: Do we prefer
1. smaller .eh_frame info and the same code as now
2. worse code in the non-exception path of code that has exception handlers?
Bear in mind most C++ functions would be affected by 2.
-- Jamie
More information about the Libc-alpha
mailing list