This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


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