Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Keith Seitz <keiths@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] Report call site for inlined functions
Date: Mon, 17 Jul 2017 19:23:00 -0000	[thread overview]
Message-ID: <20170717192334.GA11886@host1.jankratochvil.net> (raw)
In-Reply-To: <1499740601-15957-1-git-send-email-keiths@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1073 bytes --]

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

[-- Attachment #2: inlined5.c --]
[-- Type: text/plain, Size: 281 bytes --]

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

  parent reply	other threads:[~2017-07-17 19:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-11  2:36 Keith Seitz
2017-07-11  2:36 ` [PATCH 2/2] Report stop locations in " Keith Seitz
2017-07-18 17:16   ` Pedro Alves
2017-07-18 17:46     ` Pedro Alves
2017-10-20 19:21       ` Keith Seitz
2017-10-27 12:37         ` Pedro Alves
2017-10-30 21:18         ` Keith Seitz
2017-12-01 19:50           ` Pedro Alves
2017-10-20 19:02     ` Keith Seitz
2017-07-11 14:25 ` [PATCH 1/2] Report call site for " Eli Zaretskii
2017-07-17 19:23 ` Jan Kratochvil [this message]
2017-07-18 19:05 ` Pedro Alves
2017-10-20 18:46   ` Keith Seitz
2017-10-27 12:49     ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170717192334.GA11886@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox