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 exp/27265] gdbtypes.c:3429: internal-error: type* init_complex_type(const char*, type*): Assertion `target_type->code () == TYPE_CODE_INT || target_type->code () == TYPE_CODE_FLT' failed.
Date: Fri, 05 Feb 2021 09:56:44 +0000	[thread overview]
Message-ID: <bug-27265-4717-W2eG7wNJfl@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27265-4717@http.sourceware.org/bugzilla/>

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

--- 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=ae7104966177c7bcb7bef9e1445489d9d2f97f06

commit ae7104966177c7bcb7bef9e1445489d9d2f97f06
Author: Tom de Vries <tdevries@suse.de>
Date:   Fri Feb 5 10:56:39 2021 +0100

    [gdb/exp] Fix assert when adding ptr to imaginary unit

    I'm running into this assertion failure:
    ...
    $ gdb -batch -ex "p (void *)0 - 5i"
    gdbtypes.c:3430: internal-error: \
      type* init_complex_type(const char*,   type*): Assertion \
      `target_type->code () == TYPE_CODE_INT \
       || target_type->code () == TYPE_CODE_FLT' failed.
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    ...

    This is a regression since commit c34e8714662 "Implement complex
arithmetic".
    Before that commit we had:
    ...
    (gdb) p (void *)0 - 5i
    Argument to arithmetic operation not a number or boolean.
    ...

    Fix this in complex_binop by throwing an error, such that we have:
    ...
    (gdb) print (void *)0 - 5i
    Argument to complex arithmetic operation not supported.
    ...

    Tested on x86_64-linux.

    gdb/ChangeLog:

    2021-02-05  Tom de Vries  <tdevries@suse.de>

            PR exp/27265
            * valarith.c (complex_binop): Throw an error if complex type can't
            be created.

    gdb/testsuite/ChangeLog:

    2021-02-05  Tom de Vries  <tdevries@suse.de>

            PR exp/27265
            * gdb.base/complex-parts.exp: Add tests.

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

  parent reply	other threads:[~2021-02-05  9:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28  8:48 [Bug exp/27265] New: " vries at gcc dot gnu.org
2021-01-28  8:54 ` [Bug exp/27265] " vries at gcc dot gnu.org
2021-01-28 10:04 ` vries at gcc dot gnu.org
2021-01-28 11:05 ` vries at gcc dot gnu.org
2021-01-28 11:09 ` vries at gcc dot gnu.org
2021-01-28 11:26 ` vries at gcc dot gnu.org
2021-01-28 11:28 ` vries at gcc dot gnu.org
2021-01-28 12:50 ` vries at gcc dot gnu.org
2021-01-28 13:07 ` vries at gcc dot gnu.org
2021-02-05  9:56 ` cvs-commit at gcc dot gnu.org [this message]
2021-02-05  9: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-27265-4717-W2eG7wNJfl@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).