public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.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	[thread overview]
Message-ID: <bug-26390-4717-QpiPY2vehQ@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-26390-4717@http.sourceware.org/bugzilla/>

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.

  parent reply	other threads:[~2020-08-15  8:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-14 11:48 [Bug symtab/26390] New: " vries at gcc dot gnu.org
2020-08-14 12:03 ` [Bug symtab/26390] " vries at gcc dot gnu.org
2020-08-14 12:49 ` vries at gcc dot gnu.org
2020-08-14 14:52 ` vries at gcc dot gnu.org
2020-08-14 15:12 ` vries at gcc dot gnu.org
2020-08-14 15:15 ` vries at gcc dot gnu.org
2020-08-14 15:38 ` vries at gcc dot gnu.org
2020-08-14 15:39 ` vries at gcc dot gnu.org
2020-08-15  5:48 ` [Bug backtrace/26390] " vries at gcc dot gnu.org
2020-08-15  5:55 ` vries at gcc dot gnu.org
2020-08-15  8:19 ` cvs-commit at gcc dot gnu.org [this message]
2020-08-15  8:27 ` vries at gcc dot gnu.org
2020-08-15  8:28 ` vries at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-26390-4717-QpiPY2vehQ@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).