Re: [rfa] Attach vsyscall support for GNU/Linux

Andrew Cagney
2004-10-25T22:46:08Z

Mark Kettenis wrote:
> Date: Sun, 24 Oct 2004 19:16:36 -0400
> From: Daniel Jacobowitz <drow@false.org>
>
> Thanks for the explanation Daniel!
>
> Unwinding bugs aside, I think it's valuable for GDB to know that it is
> at a signal trampoline. I think the custom display in backtrace is
> valuable. That means we should look for signal handlers before looking
> for CFI. For NPTL that value judgement would fall the other way - not
> having to special-case signal handlers is a clear win.
>
> Given the fact that it is desirable for GDB to know that it's dealing
> with a signal handler, I think the correct approach is to extend the
> DWARF2 unwinder with a method to get the frame type, similar to what
> we already do for pre-initializing the register state.

The ``correct approach'' is both more complicated and simplier (the
complexity comes with the amount of refactoring, the simplicity from the
result):

At present we've the relationship:

FRAME <>---- UNWINDER
<>
|
FUNCTION ---> SYMBOL

where the UNWINDER is providing attributes and methods such as:

- unwind register
- callee frame?

while the FUNCTION provides attributes such as:

- code start/range
- function name

It needs to be changed so more like:

SYMBOL
/|\
|
FRAME <>----- FUNCTION <>------ UNWINDER

and have the FUNCTION provide:

- signal trampoline?
- code start/range
- function name

and the FUNCTION's unwinder just supply registers. For the case being
discussed, this would let us equally implement:

FRAME <>----- SIGTRAMP-FUNCTION <>----- DWARF2-UNWINDER

FRAME <>----- SIGTRAMP-FUNCTION <>----- SIGTRAMP-UNWINDER

FRAME <>----- SIGTRAMP-FUNCTION <>----- UNWINDER-PROXY

(for the last case, the actual unwinder being selected if/when needed).

On the down side, this means replacing the frame identification
heuristic found in frame-unwind with robust logic in the symtab, and
expanding symbol.

On the upside, this means that the function symbol starts correctly
identifying these probed frames (at present the're all b-).

Andrew