From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19196 invoked by alias); 6 Dec 2004 04:27:46 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 19168 invoked from network); 6 Dec 2004 04:27:40 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 6 Dec 2004 04:27:40 -0000 Received: from drow by nevyn.them.org with local (Exim 4.34 #1 (Debian)) id 1CbATI-0000A1-9k; Sun, 05 Dec 2004 23:27:36 -0500 Date: Mon, 06 Dec 2004 04:59:00 -0000 From: Daniel Jacobowitz To: Randolph Chung Cc: gdb-patches@sources.redhat.com Subject: Re: [patch/rfa] allow unwinding "past main" for dummy frames Message-ID: <20041206042736.GA496@nevyn.them.org> Mail-Followup-To: Randolph Chung , gdb-patches@sources.redhat.com References: <20041206032726.GB6359@tausq.org> <20041206034013.GA31944@nevyn.them.org> <20041206041458.GF6359@tausq.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041206041458.GF6359@tausq.org> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-12/txt/msg00154.txt.bz2 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, 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