From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18916 invoked by alias); 25 Jul 2008 14:26:19 -0000 Received: (qmail 18861 invoked by uid 22791); 25 Jul 2008 14:26:16 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 25 Jul 2008 14:25:56 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 0902A98139; Fri, 25 Jul 2008 14:25:54 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id E44269809F; Fri, 25 Jul 2008 14:25:53 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1KMOEy-0004FA-33; Fri, 25 Jul 2008 10:25:52 -0400 Date: Fri, 25 Jul 2008 14:26:00 -0000 From: Daniel Jacobowitz To: Eli Zaretskii Cc: gdb-patches@sourceware.org Subject: Re: [FYI] Inlining support, rough patch Message-ID: <20080725142551.GA15973@caradoc.them.org> Mail-Followup-To: Eli Zaretskii , gdb-patches@sourceware.org References: <20080613152754.GA4220@caradoc.them.org> <20080715192020.GB3094@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-07/txt/msg00440.txt.bz2 Thanks for looking at this. On Fri, Jul 25, 2008 at 04:54:10PM +0300, Eli Zaretskii wrote: > > +There are some ways that @value{GDBN} cannot pretend that inlined > > +function calls are the same as normal calls: > > + > > +@itemize @bullet > > +@item > > +You cannot set breakpoints on inlined functions. @value{GDBN} > > +either reports that there is no symbol with that name, or else sets the > > +breakpoint on the non-inlined copy of the function. > > + > > +@item > > +Setting breakpoints at the call site of an inlined function may not > > +work, because the call site does not contain any code. @value{GDBN} > > +may incorrectly move the breakpoint to the next line of the enclosing > > +function, after the call. > > + > > +@item > > +@value{GDBN} cannot locate the return value of inlined calls after > > +using the @code{finish} command. > > + > > +@end itemize > > This is IMO too negative: you state several problems and never hint on > how to work around them. Please consider suggesting such workarounds > in each one of the above 3 situations. Using breakpoints and returned > values reported by `finish' are two very fundamental debugging > techniques; telling the readers that they are simply unavailable will > lead them to believe debugging code that uses inlined functions is > next to impossible. Is this better? There are some ways that @value{GDBN} does not pretend that inlined function calls are the same as normal calls: @itemize @bullet @item You cannot set breakpoints on inlined functions. @value{GDBN} either reports that there is no symbol with that name, or else sets the breakpoint only on non-inlined copies of the function. This limitation will be removed in a future version of @value{GDBN}; until then, set a breakpoint by line number on the first line of the inlined function instead. @item Setting breakpoints at the call site of an inlined function may not work, because the call site does not contain any code. @value{GDBN} may incorrectly move the breakpoint to the next line of the enclosing function, after the call. This limitation will be removed in a future version of @value{GDBN}; until then, set a breakpoint on an earlier line or inside the inlined function instead. @item @value{GDBN} cannot locate the return value of inlined calls after using the @code{finish} command. This is a limitation of compiler-generated debugging information; after @code{finish}, you can step to the next line and print a variable where your program stored the return value. @end itemize -- Daniel Jacobowitz CodeSourcery