From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14719 invoked by alias); 30 Dec 2006 21:21:17 -0000 Received: (qmail 14711 invoked by uid 22791); 30 Dec 2006 21:21:17 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO brahms.sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 30 Dec 2006 21:21:11 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.13.8/8.13.8) with ESMTP id kBULKqDh026295; Sat, 30 Dec 2006 22:20:52 +0100 (CET) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.13.8/8.13.8/Submit) id kBULKqOJ031833; Sat, 30 Dec 2006 22:20:52 +0100 (CET) Date: Sat, 30 Dec 2006 21:21:00 -0000 Message-Id: <200612302120.kBULKqOJ031833@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: drow@false.org CC: pedro_alves@portugalmail.pt, gdb-patches@sourceware.org In-reply-to: <20061230204826.GD25539@nevyn.them.org> (message from Daniel Jacobowitz on Sat, 30 Dec 2006 15:48:26 -0500) Subject: Re: [PATCH] i386_skip_prologue. References: <455EE79E.6000109@portugalmail.pt> <455EF845.40902@portugalmail.pt> <455F2754.5060703@portugalmail.pt> <20061118163738.GA14800@nevyn.them.org> <457B1D40.7060302@portugalmail.pt> <20061230204826.GD25539@nevyn.them.org> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-12/txt/msg00375.txt.bz2 > Date: Sat, 30 Dec 2006 15:48:26 -0500 > From: Daniel Jacobowitz > > On Sat, Dec 09, 2006 at 08:32:00PM +0000, Pedro Alves wrote: > > The i386 targets currently don't look at line number markers > > or the symbol table at all in i386_skip_prologue. > > > > I used the attached patch to test the gcc side of the fix, > > (http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00633.html) > > > > With the gcc patch above applied, this patch fixes all the runto_main issues > > on Cygwin. There are a few other FAILs related to breakpoints and main, > > but those are testsuite bugs, unrelated to this. I will send patches for > > those shortly. > > As this is an i386-specific change, I'd been hoping Mark Kettenis could > take a look at it. Mark, any opinion on this? I'm sorry. I tend to suffer from packet loss at my side. > We've been going back and forth on prologue skipping choices for a long > time now. We have at least four options, each with at least two users: > > - skip_prologue_using_sal > - refine_prologue_limit > - this simple approach using line numbers, i.e. what you did > - sticking to analysis of the instructions > > Aside from how difficult the analysis is, there's very little target > dependent about this. It's a shame we've got so many different ways > to do it. Yes, that's my general feeling. But last time I brought it up, we didn't reach a real conclusion. > Is there a general philosophy we could adopt that would apply to most > or all targets? > > Here's a proposal to get us started: when skipping the prologue to > place a breakpoint or finish single stepping (skip_prologue), try to > skip to the end of the first sal. But some targets may optionally run > their prologue analyzer and make sure it doesn't see anything it > objects to - like jumps. That would mean the i386 prologue analyzer > would need to know about this new call to __main. When scanning the > prologue to build frame unwind information, ignore sals entirely. > Scan until we hit the saved PC or until we believe we understand > the entire frame. The last time I tried using sals on i386, I simply encountered too many cases where the line number information couldn't be trusted and putting a breakpoint on a function that was defenitely called never hit.