From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27802 invoked by alias); 5 Aug 2002 00:04: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 27795 invoked from network); 5 Aug 2002 00:04:45 -0000 Received: from unknown (HELO localhost.redhat.com) (24.112.240.27) by sources.redhat.com with SMTP; 5 Aug 2002 00:04:45 -0000 Received: from ges.redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id F271C3DDB; Sun, 4 Aug 2002 20:04:35 -0400 (EDT) Message-ID: <3D4DC113.1000700@ges.redhat.com> Date: Sun, 04 Aug 2002 17:04:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020802 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Theodore A. Roth" Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] fix for avr_skip_prologue() References: Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-08/txt/msg00090.txt.bz2 > On Sun, 4 Aug 2002, Andrew Cagney wrote: > > >>I don't think your change is any worse than many other *_skip_prologue() >>tweaks. A typical skip_prologue() function is an accumulation of >>heuristics and a lot of comments. >> > > > > >>> - if (sal.line != 0 && sal.end < func_end) >>> + /* troth/2002-70-19: For some very simple functions, gcc doesn't >>> + generate a prologue and the sal.end ends up being the insn (2 bytes) >>> + before func_end (the address of the next func). By adjusting >>> + func_end, we can catch these functions and return the correct pc. */ > >> >>I'd just also mention that the instruction in question is ``return'' and >>is two bytes long. > > > Let's see if I understand what you are saying here. It looks like sal.end > becomes the ``return'' instruction which is 1 insn (2 bytes) before > func_end. If so, it might make more sense for the patch to be Yes. that's what I think is happening based on your comments. > + if (sal.line != 0 && (sal.end+2) < func_end) > > Thus if sal.end is the ``return'' insn for the simple function, we just > return the current pc instead of sal.end. > > If that makes any sense to you, I'll fix the comment and commit it. Ok. Andrew