]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Fix Fortran regression with variables in nested functions
authorTom Tromey <tromey@adacore.com>
Tue, 13 Aug 2019 17:39:58 +0000 (11:39 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 19 Aug 2019 16:32:03 +0000 (10:32 -0600)
commitf21c2bd7b7ef2a9c47e5713cabaa784bcf5c2bee
treeb59e02ba87703ec277f2f63dbc1e6b617d3b6b92
parentd806ea2d0ef362fcddd2c1659f537b68aa114203
Fix Fortran regression with variables in nested functions

Sergio pointed out that commit commit aa3b6533 ("Allow nested function
displays") regressed a few gdb.fortran tests.  I was able to reproduce
these failures with gcc head.

The bug is that some spots calling contained_in will in fact do the
wrong thing if nested functions are considered as contained.  In the
particular case of the Fortran regression, it was the call in
block_innermost_frame, being called from get_hosting_frame -- in this
case, the caller is specifically trying to avoid the nested case.

This patch fixes the problem by adding an "allow_nested" parameter to
contained_in, essentially reverting the change for most callers.

gdb/ChangeLog
2019-08-19  Tom Tromey  <tromey@adacore.com>

* printcmd.c (do_one_display, info_display_command): Update.
* block.h (contained_in): Return bool.  Add allow_nested
parameter.
* block.c (contained_in): Return bool.  Add allow_nested
parameter.
gdb/ChangeLog
gdb/block.c
gdb/block.h
gdb/printcmd.c