Use the correct frame when evaluating a dynamic property
authorTom Tromey <tromey@adacore.com>
Wed, 1 Mar 2023 17:33:27 +0000 (10:33 -0700)
committerTom Tromey <tromey@adacore.com>
Wed, 29 Mar 2023 16:16:23 +0000 (10:16 -0600)
commit2fc3b8a4cb8439fc53975c4e70336d76e3ddc531
tree7a97dc3b1cbfb066a01ae8165c51a590f58c677d
parent168f9f95995d7958d8ae35a54c0691f46961c209
Use the correct frame when evaluating a dynamic property

The test case in this patch shows an unusual situation: an Ada array
has a dynamic bound, but the bound comes from a frame that's referred
to by the static link.  This frame is correctly found when evaluating
the array variable itself, but is lost when evaluating the array's
bounds.

This patch fixes the problem by passing this frame through to
value_at_lazy in the DWARF expression evaluator.
gdb/dwarf2/expr.c
gdb/testsuite/gdb.ada/static-link.exp [new file with mode: 0644]
gdb/testsuite/gdb.ada/static-link/pck.ads [new file with mode: 0644]
gdb/testsuite/gdb.ada/static-link/prog.adb [new file with mode: 0644]