From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14160 invoked by alias); 4 Aug 2002 20:54:45 -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 14153 invoked from network); 4 Aug 2002 20:54:44 -0000 Received: from unknown (HELO thevenin.amplepower.com) (216.39.162.139) by sources.redhat.com with SMTP; 4 Aug 2002 20:54:44 -0000 Received: from [192.168.8.29] (helo=thirring.amplepower.com) by thevenin.amplepower.com with esmtp (Exim 3.35 #1 (Debian)) id 17bSMB-0003gd-00; Sun, 04 Aug 2002 13:52:07 -0700 Date: Sun, 04 Aug 2002 13:54:00 -0000 From: "Theodore A. Roth" X-X-Sender: troth@oscar.mynet To: Andrew Cagney cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] fix for avr_skip_prologue() In-Reply-To: <3D4D83BF.1080504@ges.redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2002-08/txt/msg00087.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 + 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. Ted Roth