From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4865 invoked by alias); 30 Nov 2011 17:07:00 -0000 Received: (qmail 4851 invoked by uid 22791); 30 Nov 2011 17:06:58 -0000 X-SWARE-Spam-Status: No, hits=-7.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 30 Nov 2011 17:06:41 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pAUH6fxH030041 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 30 Nov 2011 12:06:41 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pAUH6ePi013673; Wed, 30 Nov 2011 12:06:40 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id pAUH6dRH013597; Wed, 30 Nov 2011 12:06:39 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Subject: Re: [RFA] Allow setting breakpoints on inline functions (PR 10738) References: <20111129150200.GB3425@redhat.com> Date: Wed, 30 Nov 2011 17:07:00 -0000 In-Reply-To: <20111129150200.GB3425@redhat.com> (Gary Benson's message of "Tue, 29 Nov 2011 15:02:00 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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: 2011-11/txt/msg00850.txt.bz2 >>>>> "Gary" == Gary Benson writes: Gary> This patch, which applies on top of Tom's ambiguous linespec work, Gary> allows you to set breakpoints on inlined functions. Although it Gary> can't be committed until Tom's stuff goes in, I'm posting it for Gary> feedback now. This is super. Thanks. I noticed that the manual node "Inline Functions" says: There are some ways that GDB does not pretend that inlined function calls are the same as normal calls: * You cannot set breakpoints on inlined functions. GDB 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 GDB; until then, set a breakpoint by line number on the first line of the inlined function instead. [...] I think this needs a small update. Also I think this feature deserves a NEWS entry. I checked it out and played with it a little. I found one little bug. Using the inline-break test case from the patch: (gdb) p &func1 $1 = (int (*)(int)) 0x4003d8 That is, it chooses the location of the inline function as the address of the function when evaluating an expression. I think this is wrong. Instead, it should ignore inline instances here, returning the address of the out-of-line instance. And, if there is no out-of-line (as in this case), it should error. I think one possible way to do this would be to put a flag on symbols, marking inline instances, and then have ordinary symbol lookup ignore such symbols. I am not sure how hard this would be. There might also be other approaches. Tom