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 gdb/26393] gdbtypes.h:526: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed. (recursive_dump_type)
Date: Mon, 17 Aug 2020 07:54:41 +0000	[thread overview]
Message-ID: <bug-26393-4717-j5fEWSpfBL@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-26393-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=26393

--- Comment #2 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=53d5a2a5c146f98dd525eda2f33d7781666463bf

commit 53d5a2a5c146f98dd525eda2f33d7781666463bf
Author: Tom de Vries <tdevries@suse.de>
Date:   Mon Aug 17 09:54:37 2020 +0200

    [gdb] Fix printing of unresolved dynamic type

    When debugging gdb in batch mode with executable mixed-lang-stack and doing
a
    backtrace at breakpt:
    ...
    $ gdb --args gdb \
      -batch \
      outputs/gdb.fortran/mixed-lang-stack/mixed-lang-stack \
      -ex "b breakpt" \
      -ex r \
      -ex bt
    ...
    and stopping at resolve_dynamic_type to print the type:
    ...
    (gdb) b resolve_dynamic_type
    Breakpoint 1 at 0x6b020c: file gdbtypes.c, line 2633.
    (gdb) commands
    Type commands for breakpoint(s) 1, one per line.
    End with a line saying just "end".
    >call recursive_dump_type (type, 0)
    >continue
    >end
    (gdb) run
    ...
    we eventually run into an assert for the dynamic type of "str":
    ...
    Thread 1 "gdb" hit Breakpoint 1, resolve_dynamic_type (type=0x22204f0, \
      valaddr=..., addr=4199408) at gdbtypes.c:2633
    2633        = {check_typedef (type), valaddr, addr, NULL};
    type node 0x22204f0
    name '<NULL>' (0x0)
    code 0xd (TYPE_CODE_STRING)
    length 0
      ...
        nfields 0 0x22204b0
    gdbtypes.h:526: internal-error: LONGEST dynamic_prop::const_val() const: \
      Assertion `m_kind == PROP_CONST' failed.
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    ...
    when trying to print the high bound of a TYPE_CODE_RANGE, which has m_kind
    PROP_LOCEXPR, while the code in resolve_dynamic_type assumes PROP_CONST.

    Fix this by extending the printing of TYPE_CODE_RANGE to allow
    PROP_LOCEXPR/PROP_LOCLIST as well, such that we have instead:
    ...
        nfields 0 0x1fbc020
        low 1  high (dynamic)
    ...

    Tested on x86_64-linux.

    gdb/ChangeLog:

    2020-08-17  Tom de Vries  <tdevries@suse.de>

            PR gdb/26393
            * gdbtypes.c (dump_dynamic_prop): New function.
            (recursive_dump_type): Use dump_dynamic_prop for TYPE_CODE_RANGE.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2020-08-17  7:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-15  8:26 [Bug gdb/26393] New: gdbtypes.h:526: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed. (dump_recursive_type) vries at gcc dot gnu.org
2020-08-16 15:55 ` [Bug gdb/26393] gdbtypes.h:526: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed. (recursive_dump_type) vries at gcc dot gnu.org
2020-08-17  1:58 ` simark at simark dot ca
2020-08-17  7:54 ` cvs-commit at gcc dot gnu.org [this message]
2020-08-17  7:58 ` 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-26393-4717-j5fEWSpfBL@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).