]> gcc.gnu.org Git - gcc.git/commit
coroutines: Support for debugging implementation state.
authorIain Sandoe <iain@sandoe.co.uk>
Fri, 9 Jul 2021 20:01:41 +0000 (21:01 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Fri, 3 Sep 2021 18:42:43 +0000 (19:42 +0100)
commitaddf167a23f61c0ec97f6e71577a0623f3fc13e7
tree7f704f2b3ea18eff8062ff7a8e4b8a141ba0ecbe
parenta45a7ecdf34311587daa2e90cc732adcefac447b
coroutines: Support for debugging implementation state.

Some of the state that is associated with the implementation
is of interest to a user debugging a coroutine.  In particular
items such as the suspend point, promise object, and current
suspend point.

These variables live in the coroutine frame, but we can inject
proxies for them into the outermost bind expression of the
coroutine.  Such variables are automatically moved into the
coroutine frame (if they need to persist across a suspend
expression).  PLacing the proxies thus allows the user to
inspect them by name in the debugger.

To implement this, we ensure that (at the outermost scope) the
frame entries are not mangled (coroutine frame variables are
usually mangled with scope nesting information so that they do
not clash).  We can safely avoid doing this for the outermost
scope so that we can map frame entries directly to the variables.

This is partial contribution to debug support (PR 99215).

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/cp/ChangeLog:

* coroutines.cc (register_local_var_uses): Do not mangle
frame entries for the outermost scope.  Record the outer
scope as nesting depth 0.
gcc/cp/coroutines.cc
This page took 0.055572 seconds and 5 git commands to generate.