Re: Stepping over longjmp presumably broken for glibc

Daniel Jacobowitz
2005-12-30T16:25:12Z

On Fri, Dec 30, 2005 at 10:32:11AM +0100, Mark Kettenis wrote:
> > Date: Thu, 29 Dec 2005 21:38:31 -0500
> > From: Daniel Jacobowitz <drow@false.org>
> >
> > On Mon, Dec 26, 2005 at 08:24:30PM -0800, Jim Blandy wrote:
> > > Here's my (non-qualifying because it relies on help from the runtime)
> > > idea: can't we use Dwarf CFI here? That is, treat longjmp as a weird
> > > function whose CFI indicates that it unwinds to the setjmp. The
> > > DW_CFA_val_expression operator, new in the released Dwarf 3 spec,
> > > allows CFI to use an arbitrary expression to compute the saved value
> > > of the register; we can apply that to the return address column just
> > > as well as anything else. In the case Daniel described, the
> > > expression would use DW_OP_xor (probably the first use ever of that
> > > opcode!).
> >
> > How would you distinguish a longjmp with CFI that returns to caller
> > from a longjmp with CFI that returns to setjmp?
>
> Huh? longjmp() always returns to a context saved by a setjmp().

That's not what I meant - I meant between a longjmp with "normal"
unwind information, or with Jim's proposed "magic" unwind information
that returned to the setjmp target. There's got to be at least one of
the former out there somewhere...

--
Daniel Jacobowitz
CodeSourcery, LLC