From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2725 invoked by alias); 17 Apr 2003 20:44:08 -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 2718 invoked from network); 17 Apr 2003 20:44:07 -0000 Received: from unknown (HELO neon-gw.transmeta.com) (63.209.4.196) by sources.redhat.com with SMTP; 17 Apr 2003 20:44:07 -0000 Received: (from root@localhost) by neon-gw.transmeta.com (8.9.3/8.9.3) id NAA12991; Thu, 17 Apr 2003 13:43:10 -0700 Received: from mailhost.transmeta.com(10.1.1.15) by neon-gw.transmeta.com via smap (V2.1) id xma012975; Thu, 17 Apr 03 13:42:55 -0700 Received: from casey.transmeta.com (casey.transmeta.com [10.10.25.22]) by deepthought.transmeta.com (8.11.6/8.11.6) with ESMTP id h3HKgwa17534; Thu, 17 Apr 2003 13:42:58 -0700 (PDT) Received: (from dje@localhost) by casey.transmeta.com (8.9.3/8.7.3) id NAA30887; Thu, 17 Apr 2003 13:42:58 -0700 From: Doug Evans MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16031.4562.644834.479261@casey.transmeta.com> Date: Thu, 17 Apr 2003 20:44:00 -0000 To: Daniel Jacobowitz Cc: Matt Thomas , Michael Snyder , gdb@sources.redhat.com Subject: Re: breakpoint commands and finish In-Reply-To: <20030417201909.GA2867@nevyn.them.org> References: <5.1.1.6.2.20030414135022.04175790@3am-software.com> <5.1.1.6.2.20030417114351.04b179c0@3am-software.com> <20030417201909.GA2867@nevyn.them.org> X-SW-Source: 2003-04/txt/msg00204.txt.bz2 Daniel Jacobowitz writes: > > rbreak (or ebreak). I find I often was to place a breakpoint at the > > end of a function; it'd be nice if gdb could do that automaticly. > > It's too darned hard :) Debug info does not represent the exit point > of the function. It's not always at the end; modern gcc's can emit > multiple exit edges, too. And if a tail-call optimization has been done, it gets even harder. OTOH, if one stops at the first instruction of a function, presumably it'd then be easy to set a breakpoint at the return address. I wonder if gdb's macro facility is sufficient to write a macro that would make this almost user-friendly: it would set a breakpoint at the start of the function (pre-prologue) then have commands that first sets a tbreak breakpoint at the return address and then continues. You couldn't already be in the function of course (but if you were presumably you'd use "finish"). ?