[Bug backtrace/26390] gdb.fortran/mixed-lang-stack.exp: error reading variable in backtrace
cvs-commit at gcc dot gnu.org
sourceware-bugzilla@sourceware.org
Sat Aug 15 08:19:17 GMT 2020
https://sourceware.org/bugzilla/show_bug.cgi?id=26390
--- Comment #9 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=547ce8f00b4ef826bdc9bf9a74f119fe9768852e
commit 547ce8f00b4ef826bdc9bf9a74f119fe9768852e
Author: Tom de Vries <tdevries@suse.de>
Date: Sat Aug 15 10:19:13 2020 +0200
[gdb/backtrace] Fix printing of fortran string args
When running test-case gdb.fortran/mixed-lang-stack.exp, it passes, but we
find in gdb.log:
...
(gdb) bt^M
...
#7 0x000000000040113c in mixed_func_1b (a=1, b=2, c=3, d=(4,5), \
e=<error reading variable: value requires 140737488341744 bytes, which \
is more than max-value-size>, g=..., _e=6) at mixed-lang-stack.f90:87^M
...
while a bit later in gdb.log, we have instead for the same frame (after
adding a gdb_test_no_output "set print frame-arguments all" to prevent
getting "e=..."):
...
(gdb) up^M
#7 0x000000000040113c in mixed_func_1b (a=1, b=2, c=3, d=(4,5), \
e='abcdef', g=( a = 1.5, b = 2.5 ), _e=6) at mixed-lang-stack.f90:87^M
...
The difference is that in the latter case, we print the frame while it's
selected, while in the former, it's not.
The problem is that while trying to resolve the dynamic type of e in
resolve_dynamic_type, we call dwarf2_evaluate_property with a frame == NULL
argument, and then use the selected frame as the context in which to
evaluate
the dwarf property, effectively evaluating a DW_OP_fbreg operation in the
wrong frame context.
Fix this by temporarily selecting the frame of which we're trying to print
the
arguments in print_frame_args, borrowing code from print_frame_local_vars
that
was added to fix a similar issue in commit 16c3b12f19 "error/internal-error
printing local variable during "bt full".
Build and tested on x86_64-linux.
gdb/ChangeLog:
2020-08-15 Tom de Vries <tdevries@suse.de>
PR backtrace/26390
* stack.c (print_frame_args): Temporarily set the selected
frame to FRAME while printing the frame's arguments.
gdb/testsuite/ChangeLog:
2020-08-15 Tom de Vries <tdevries@suse.de>
PR backtrace/26390
* gdb.fortran/mixed-lang-stack.exp: Call bt with -frame-arguments
all.
Update expected pattern.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Gdb-prs
mailing list