public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Indicating function exit points in debug data
@ 2019-03-19 20:38 Justin Paston-Cooper
  2019-03-19 21:29 ` Florian Weimer
  2019-03-20  8:31 ` Richard Biener
  0 siblings, 2 replies; 14+ messages in thread
From: Justin Paston-Cooper @ 2019-03-19 20:38 UTC (permalink / raw)
  To: gcc

Hello,

In my message https://sourceware.org/ml/gdb/2019-03/msg00042.html to
the gdb mailing list, I asked whether it would be possible to
implement a command which breaks at all exit points of the current
stack frame. This would be very useful for evaluating a function's
final state before it returns its result, independent of where in its
definition it returns from.

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.

It would be nice if this new break on exit command worked both for
inlined functions, and also the case of breaking after tail-recursions
exit. With a single stone, the "finish" bird above is also killed.

Would it be feasible to implement such a feature in gcc? If I'm not
the first person to ask for this, are there any architectural or
practical reasons as to why it might not be possible to implement? As
it stands, I don't have the level of familiarity with gcc to come to
you with a patch, but with guidance I would certainly be interested in
working on the C/C++ case if that would be useful.

Thanks,

Justin

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-03-21  9:34 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-19 20:38 Indicating function exit points in debug data 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
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

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).