This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Help: Unwinding the C++ stack...throw, longjmp & threads


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]