From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 98DE138708D7; Sat, 15 Aug 2020 08:19:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98DE138708D7 From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug backtrace/26390] gdb.fortran/mixed-lang-stack.exp: error reading variable in backtrace Date: Sat, 15 Aug 2020 08:19:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: backtrace X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Aug 2020 08:19:17 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26390 --- Comment #9 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Tom de Vries : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D547ce8f00b4e= f826bdc9bf9a74f119fe9768852e commit 547ce8f00b4ef826bdc9bf9a74f119fe9768852e Author: Tom de Vries 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=3D1, b=3D2, c=3D3, d=3D(4,5= ), \ e=3D, g=3D..., _e=3D6) at mixed-lang-stack.f= 90: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=3D..."): ... (gdb) up^M #7 0x000000000040113c in mixed_func_1b (a=3D1, b=3D2, c=3D3, d=3D(4,5= ), \ e=3D'abcdef', g=3D( a =3D 1.5, b =3D 2.5 ), _e=3D6) at mixed-lang-st= ack.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 =3D= =3D 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 t= he wrong frame context. Fix this by temporarily selecting the frame of which we're trying to pr= int the arguments in print_frame_args, borrowing code from print_frame_local_va= rs that was added to fix a similar issue in commit 16c3b12f19 "error/internal-e= rror printing local variable during "bt full". Build and tested on x86_64-linux. gdb/ChangeLog: 2020-08-15 Tom de Vries 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 PR backtrace/26390 * gdb.fortran/mixed-lang-stack.exp: Call bt with -frame-argumen= ts all. Update expected pattern. --=20 You are receiving this mail because: You are on the CC list for the bug.=