From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12412 invoked by alias); 15 Mar 2002 18:41:06 -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 12340 invoked from network); 15 Mar 2002 18:41:05 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 15 Mar 2002 18:41:05 -0000 Received: from cse.cygnus.com (cse.cygnus.com [205.180.230.236]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id KAA29519; Fri, 15 Mar 2002 10:41:04 -0800 (PST) Received: (from kev@localhost) by cse.cygnus.com (8.11.6/8.11.6) id g2FIepD27572; Fri, 15 Mar 2002 11:40:51 -0700 Date: Fri, 15 Mar 2002 10:41:00 -0000 From: Kevin Buettner Message-Id: <1020315184051.ZM27571@localhost.localdomain> In-Reply-To: Michal Ludvig "[RFA] x86_64_skip_prologue" (Mar 15, 7:22pm) References: <3C923BD9.80403@suse.cz> X-Mailer: Z-Mail (4.0.1 13Jan97 Caldera) To: Michal Ludvig , gdb-patches@sources.redhat.com Subject: Re: [RFA] x86_64_skip_prologue MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-03/txt/msg00245.txt.bz2 On Mar 15, 7:22pm, Michal Ludvig wrote: > I have written a new x86_64_skip_prologue() function. The approach is, > 1) Detect, wherher the function seems to have a prolog (ie. starts with > instructions push %rbp and mov %rsp,%rbp). If not, return pc and exit. > 2) Try to get debuginfo. If not, just return pc. > 3) Now pc points to the first line of the sourcecode of the function > (usually opening '{'). If the next line with debuginfo has pc within > bounds of this function, we will return this pc instead. You might want to take a look at some of the other prologue analyzers. In particular, you might want to consider calling find_pc_line() instead of accessing the data structures directly. > Anyway I'm not sure, wherher the lines in linetab _must_ grow up > monotonically (I assume so). I believe it can be non-monotonic for optimized code. BTW, you might want to run your code through indent. Kevin