This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/2] Report call site for inlined functions
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 17 Jul 2017 21:23:34 +0200
- Subject: Re: [PATCH 1/2] Report call site for inlined functions
- Authentication-results: sourceware.org; auth=none
- 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 dot kratochvil at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B61E178EA2
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B61E178EA2
- References: <1499740601-15957-1-git-send-email-keiths@redhat.com>
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
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;
}