From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26052 invoked by alias); 15 Oct 2004 18:42:31 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 26037 invoked from network); 15 Oct 2004 18:42:30 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 15 Oct 2004 18:42:30 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.10) with ESMTP id i9FIgPCS018644 for ; Fri, 15 Oct 2004 14:42:30 -0400 Received: from localhost.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i9FIgDr06960; Fri, 15 Oct 2004 14:42:13 -0400 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 5980228CF; Fri, 15 Oct 2004 14:42:07 -0400 (EDT) Message-ID: <417019FE.4030403@gnu.org> Date: Fri, 15 Oct 2004 22:34:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20041009 MIME-Version: 1.0 To: Dave Korn , "'Mark Kettenis'" , ashishm@linsyssoft.com Cc: "'David Lecomber'" , gdb@sources.redhat.com Subject: Re: Possible improvement to i386 function prologue analysis. References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-10/txt/msg00333.txt.bz2 >>> Please suggest if it would be worthwhile to work on a >>> similar check for >>> special instructions within the for loop in >>> i386_analyze_register_saves(). >>> This will enable it to continue reading saved registers over such >>> occurances. > > > It's a consequence of the introduction of RTL prolog generation in recent > versions of gcc; before, prologs and epilogs were output as straight > hard-coded assembler. Now that they are generated from RTL insns, it is > possible for the scheduler to move instructions from the body of the > function into the prologue itself. While this is good for performance, it > means that basically _any_ instruction can be found in the prolog. This > makes writing the code to disassemble and interpret the prolog a good deal > more difficult. > > >>> It's not as important as getting the stack frame setup right (which is >>> why the code in i386_analyze_frame_setup is there), but it would >>> certainly be nice to have it. There a slight complication though. >>> The prologue analyzing stuff is also used for implementing >>> i386_skip_prologue(). Now i386_skip_prologue() shouldn't dwell too >>> far into the function. Skipping the instructions we're talking about >>> here might just do that. GCC, at -O0, should not be mixing prologue and code body. Dwarf3 does define a function prologue address attribute, and if available GDB should use prefer it over the heuristic. Andrew