[PATCH] Fix Fortran regression with variables in nested functions

Kevin Buettner kevinb@redhat.com
Wed Aug 14 22:04:00 GMT 2019


On Tue, 13 Aug 2019 12:26:24 -0600
Tom Tromey <tromey@adacore.com> wrote:

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

This patch fixes regressions that I was seeing in my OpenMP work,
so I'm in favor of it going in.

Kevin



More information about the Gdb-patches mailing list