This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/2] Report call site for inlined functions


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;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]