[Bug go/93844] [debug] Incorrect scope for local variables
vries at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Feb 20 10:34:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93844
--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> The only way to capture these may
> be to introduce additional scoping in the FEs whenever new local decls
> are added. Also consider
>
> const char *oldst = st;
> const char *st = "Hello, world!";
>
> so even consecutive inits may need two separate scopes.
At the DWARF side, DW_AT_start_scope looks applicable:
...
The debugging information entry for a program variable, formal parameter or
constant may have the following attributes:
...
11. A DW_AT_start_scope attribute if the scope of an object is smaller than
(that is, is a subset of the addresses of) the scope most closely enclosing the
object.
...
Maybe this can be generating without introducing additional scoping?
More information about the Gcc-bugs
mailing list