Thanks,
Jan
-diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
---- a/gdb/dwarf2loc.c
-+++ b/gdb/dwarf2loc.c
-@@ -42,6 +42,7 @@
- #include <algorithm>
- #include <vector>
- #include <unordered_set>
-+#include <functional>
- #include "common/underlying.h"
- #include "common/byte-vector.h"
-
-@@ -2348,6 +2349,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
+diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
+--- a/gdb/dwarf2/loc.c
++++ b/gdb/dwarf2/loc.c
+@@ -2249,6 +2249,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
ctx.per_cu = per_cu;
ctx.obj_address = 0;
+
scoped_value_mark free_values;
- ctx.gdbarch = get_objfile_arch (objfile);
+ ctx.gdbarch = per_objfile->objfile->arch ();
diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
new file mode 100644
--- /dev/null
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
-+#
++#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
-+#
++#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+set testfile "dynamic-other-frame"
+set srcfile1 ${testfile}.f90