[patch/rfa] allow unwinding "past main" for dummy frames

Daniel Jacobowitz drow@false.org
Mon Dec 6 04:59:00 GMT 2004

On Sun, Dec 05, 2004 at 08:14:58PM -0800, Randolph Chung wrote:
> so, what happens is that we call __gcc_plt_call using a stack trampoline
> which tells __gcc_plt_call to return to "current function". after
> __gcc_plt_call calls the callee function, it looks up the return address
> ("current function") and restores the space registers to the correct
> value for that address. ergo, <dummy frame> actually has a frame pc that
> belongs to "current function", and if that's main, dummy frame will
> trigger the inside_main_func check.
> does this make sense?

Some sense, but not good sense.

Can we edit the space registers ourselves?  If so, why don't we rely on
that?  I'm not talking about the call, just the return.  So generate a
call to __gcc_plt_call with a return address anywhere you please, and
after the dummy call when we restore the saved regcache the space
registers will be right again.  So you could just use _start.

Daniel Jacobowitz

More information about the Gdb-patches mailing list