From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44800 invoked by alias); 17 Jul 2017 19:23:42 -0000 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 Received: (qmail 44776 invoked by uid 89); 17 Jul 2017 19:23:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.1 required=5.0 tests=BAYES_00,GIT_PATCH_2,KAM_ASCII_DIVIDERS,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1301, reality, site X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Jul 2017 19:23:38 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B61E178EA2 for ; Mon, 17 Jul 2017 19:23:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B61E178EA2 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jan.kratochvil@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B61E178EA2 Received: from host1.jankratochvil.net (ovpn-116-70.ams2.redhat.com [10.36.116.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 02669173BA; Mon, 17 Jul 2017 19:23:36 +0000 (UTC) Date: Mon, 17 Jul 2017 19:23:00 -0000 From: Jan Kratochvil To: Keith Seitz Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 1/2] Report call site for inlined functions Message-ID: <20170717192334.GA11886@host1.jankratochvil.net> References: <1499740601-15957-1-git-send-email-keiths@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="BOKacYhQ+x31HxR3" Content-Disposition: inline In-Reply-To: <1499740601-15957-1-git-send-email-keiths@redhat.com> User-Agent: Mutt/1.8.3 (2017-05-23) X-SW-Source: 2017-07/txt/msg00232.txt.bz2 --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1073 Hi Keith, with attached file on Fedora 25 x86_64 'gcc -g' (not any -O): ------------------------------------------------------------------------------ (gdb) b g Breakpoint 1 at 0x4004ce: file inlined5.c, line 12. (gdb) r Starting program: inlined5 Breakpoint 1, g (a=1) at inlined5.c:12 12 f (a); (gdb) bt #0 g (a=1) at inlined5.c:12 #1 h (a=1) at inlined5.c:20 #2 main () at inlined5.c:28 (gdb) info breakpoints Num Type Disp Enb Address What 1 breakpoint keep y 0x00000000004004ce in g at inlined5.c:10 inlined in main at inlined5.c:20 breakpoint already hit 1 time (gdb) ------------------------------------------------------------------------------ I think g is inlined into h which is inlined into main. Personally I think it would be enough to say "in g" as the rest is a toolchain implementation detail. But if it tries to describe the code layout then it should match the reality. The MI attributes would also need to be adjusted for multi-level inlines. Jan --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="inlined5.c" Content-length: 281 int e; static __attribute__ ((__noinline__)) void f (int a) { e = a; } static __attribute__ ((__always_inline__)) void g (int a) { f (a); e = a; } static __attribute__ ((__always_inline__)) void h (int a) { g (a); e = a; } int main (void) { h (1); return 0; } --BOKacYhQ+x31HxR3--