public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Justin Paston-Cooper <paston.cooper@gmail.com>
To: Florian Weimer <fw@deneb.enyo.de>
Cc: gcc@gcc.gnu.org
Subject: Re: Indicating function exit points in debug data
Date: Tue, 19 Mar 2019 22:20:00 -0000	[thread overview]
Message-ID: <CAEndGgRg2g33y8-mY_M2EDOvE352T=0F7ikEKgnnMu=Xhwo0EQ@mail.gmail.com> (raw)
In-Reply-To: <87ftriilbk.fsf@mid.deneb.enyo.de>

On Tue, 19 Mar 2019 at 21:52, Florian Weimer <fw@deneb.enyo.de> wrote:
>
> * Justin Paston-Cooper:
>
> > On Tue, 19 Mar 2019 at 21:29, Florian Weimer <fw@deneb.enyo.de> wrote:
> >>
> >> * Justin Paston-Cooper:
> >>
> >> > Tom Tromey suggested in that thread that this would be quite easy on
> >> > gdb's side if gcc indicates exit locations in the DWARF data, for
> >> > instance in the C case, it would indicate the locations of return
> >> > statements. On a related note, he mentions that the "finish" command
> >> > does not work for inlined functions because the compiler does not emit
> >> > the required information.
> >>
> >> What about calls to noreturn functions?  I assume they would need
> >> breakpoints as well.  It could be tricky if those are only called
> >> indirectly, I assume.
> >
> > Couldn't the brace following the final line of an inlined noreturn
> > function be viewed as its exit point and be indicated in the DWARF
> > information accordingly?
>
> That breakpoint would never be reached.

Then if the break on exit command would break on return statements of
functions which return, then it could break on the final statement of
a noreturn?

>
> > Is the problem that each entry in the line
> > number table has to point to a specific statement? Could you explain
> > what you mean with "indirectly"?
>
> In C++, a function might return to the caller by calling *another*
> function which throws an exception.
>
> Similarly, in C, a function could call a function that in turn calls
> longjmp.
>
> Or more prosaically, a called function might call the exit function.
>
> I'm just wondering if such abnormal exits should be covered as well,
> and calling a noreturn function could be a reasonable indicator.

  reply	other threads:[~2019-03-19 22:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19 20:38 Justin Paston-Cooper
2019-03-19 21:29 ` Florian Weimer
2019-03-19 21:41   ` Justin Paston-Cooper
2019-03-19 21:52     ` Florian Weimer
2019-03-19 22:20       ` Justin Paston-Cooper [this message]
2019-03-19 22:40         ` Florian Weimer
2019-03-19 22:52           ` Justin Paston-Cooper
2019-03-20  8:31 ` Richard Biener
2019-03-20 10:13   ` Justin Paston-Cooper
2019-03-20 17:36     ` Segher Boessenkool
2019-03-20 19:05       ` Tom Tromey
2019-03-21  8:23         ` Richard Biener
2019-03-21  9:11           ` Justin Paston-Cooper
2019-03-21  9:34             ` Justin Paston-Cooper

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='CAEndGgRg2g33y8-mY_M2EDOvE352T=0F7ikEKgnnMu=Xhwo0EQ@mail.gmail.com' \
    --to=paston.cooper@gmail.com \
    --cc=fw@deneb.enyo.de \
    --cc=gcc@gcc.gnu.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).