Allow nested function displays
authorTom Tromey <tromey@adacore.com>
Thu, 6 Jun 2019 17:20:51 +0000 (11:20 -0600)
committerTom Tromey <tromey@adacore.com>
Tue, 30 Jul 2019 18:34:51 +0000 (12:34 -0600)
commitaa3b653351504e262fb455af5efb6eea6d981597
tree938ce24709ea2bd8f16c6da92dc819637d8ae613
parenta1530dc7319595b5980e8501092782724c946351
Allow nested function displays

In Ada, it's possible to have nested functions.  However,
block.c:contained_in does not recognize this.  Normally, this is no
problem, but if gdb is stopped inside a nested function, then you can
end up in the unexpected situation that "print" of an expression will
work, whereas "display" of the same expression will not -- because
contained_in returns 0.

This patch simply removes the BLOCK_FUNCTION check from contained_in.
The rationale here is that in languages without nested functions, this
will not cause any issues.

gdb/ChangeLog
2019-07-30  Tom Tromey  <tromey@adacore.com>

* block.c (contained_in): Remove BLOCK_FUNCTION check.

gdb/testsuite/ChangeLog
2019-07-30  Tom Tromey  <tromey@adacore.com>

* gdb.ada/display_nested.exp: New file.
* gdb.ada/display_nested/foo.adb: New file.
* gdb.ada/display_nested/pack.adb: New file.
* gdb.ada/display_nested/pack.ads: New file.
gdb/ChangeLog
gdb/block.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/display_nested.exp [new file with mode: 0644]
gdb/testsuite/gdb.ada/display_nested/foo.adb [new file with mode: 0644]
gdb/testsuite/gdb.ada/display_nested/pack.adb [new file with mode: 0644]
gdb/testsuite/gdb.ada/display_nested/pack.ads [new file with mode: 0644]
This page took 0.024584 seconds and 4 git commands to generate.