aboutsummaryrefslogtreecommitdiff
path: root/gdb/block.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-06-06 11:20:51 -0600
committerTom Tromey <tromey@adacore.com>2019-07-30 12:34:51 -0600
commitaa3b653351504e262fb455af5efb6eea6d981597 (patch)
tree938ce24709ea2bd8f16c6da92dc819637d8ae613 /gdb/block.c
parenta1530dc7319595b5980e8501092782724c946351 (diff)
downloadgdb-aa3b653351504e262fb455af5efb6eea6d981597.zip
gdb-aa3b653351504e262fb455af5efb6eea6d981597.tar.gz
gdb-aa3b653351504e262fb455af5efb6eea6d981597.tar.bz2
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.
Diffstat (limited to 'gdb/block.c')
-rw-r--r--gdb/block.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/gdb/block.c b/gdb/block.c
index 63c7d9f..5c6faa8 100644
--- a/gdb/block.c
+++ b/gdb/block.c
@@ -79,10 +79,6 @@ contained_in (const struct block *a, const struct block *b)
{
if (a == b)
return 1;
- /* If A is a function block, then A cannot be contained in B,
- except if A was inlined. */
- if (BLOCK_FUNCTION (a) != NULL && !block_inlined_p (a))
- return 0;
a = BLOCK_SUPERBLOCK (a);
}
while (a != NULL);