public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries 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: Thu, 28 Jan 2021 11:28:16 +0000	[thread overview]
Message-ID: <bug-27265-4717-kN4riu9EBg@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 #6 from Tom de Vries <vries at gcc dot gnu.org> ---
This seems to fix it:
...
diff --git a/gdb/valarith.c b/gdb/valarith.c
index 81d48aae82a..b4337492694 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -1171,8 +1171,12 @@ scalar_binop (struct value *arg1, struct value *arg2,
enum exp_
opcode op)
   type1 = check_typedef (value_type (arg1));
   type2 = check_typedef (value_type (arg2));

-  if (type1->code () == TYPE_CODE_COMPLEX
-      || type2->code () == TYPE_CODE_COMPLEX)
+  if ((type1->code () == TYPE_CODE_COMPLEX
+       && (type2->code () == TYPE_CODE_INT
+          || type2->code () == TYPE_CODE_FLT))
+      || ((type2->code () == TYPE_CODE_COMPLEX
+          && (type1->code () == TYPE_CODE_INT
+              || type1->code () == TYPE_CODE_FLT))))
     return complex_binop (arg1, arg2, op);

   if ((!is_floating_value (arg1)
...

We're back to:
...
$ gdb -batch -ex "p (void *)0 + 1i"
Argument to arithmetic operation not a number or boolean.
$ gdb -batch -ex "p (_Decimal32)0.0 + 1i"
Argument to arithmetic operation not a number or boolean.
...

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

  parent reply	other threads:[~2021-01-28 11:28 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 [this message]
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
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-kN4riu9EBg@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).