public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Luis Machado <luis.machado@arm.com>
To: "Kempke, Nils-Christian" <nils-christian.kempke@intel.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH v3 00/11] Improve Fortran intrinsic types and procedures
Date: Mon, 25 Apr 2022 14:41:33 +0100	[thread overview]
Message-ID: <b162675a-4bfb-8655-697d-1f3b55a1571a@arm.com> (raw)
In-Reply-To: <CY4PR1101MB20714F29D956D17A121A764BB8F89@CY4PR1101MB2071.namprd11.prod.outlook.com>

On 4/25/22 14:19, Kempke, Nils-Christian wrote:
> Hi,
> 
> Sorry for that - I think the assert should have been removed anyway.
> 

Not a problem. I just want to make sure I understand the failure and 
what needs to be done to address it.

> I might have missed removing it - but the two lines below are what I wrote instead - an
> error and gdb should not crash..
> 
>    if (value_type (arg1)->code () == TYPE_CODE_COMPLEX
>        || value_type (arg2)->code () == TYPE_CODE_COMPLEX)
>      error (_("Types of arguments for CMPLX called with more then one argument "
> 	     "must be REAL or INTEGER"));
> 
> Does removing the assert do that? I'd assume the tests then just FAIL.
> 

Just for informational purposes, dropping the assertion makes the code 
assert somewhere else.

We could stop with an error like "Unsupported kind" if kind_arg->code () 
is unexpected, but I'm wondering if we could've caught this somewhere 
else before calling into this function with something we know is wrong 
already. If we could do that, then we would fail early, and possibly 
more gracefully.

I see errors of the following type:

"unsupported kind 1 for type complex*4"

This gives a bit more information, but I don't think a code == 
TYPE_CODE_ERROR gives us a chance to show anything more.

      parent reply	other threads:[~2022-04-25 13:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-11  8:18 Nils-Christian Kempke
2022-04-11  8:18 ` [PATCH v3 11/11] gdb/doc: add section about Fortran intrinsic functions and types Nils-Christian Kempke
2022-04-11 11:38   ` Eli Zaretskii
2022-04-11 12:08     ` Kempke, Nils-Christian
2022-04-25 12:52 ` [PATCH v3 00/11] Improve Fortran intrinsic types and procedures Luis Machado
2022-04-25 13:19   ` Kempke, Nils-Christian
2022-04-25 13:21     ` Kempke, Nils-Christian
2022-04-25 13:41     ` Luis Machado [this message]

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=b162675a-4bfb-8655-697d-1f3b55a1571a@arm.com \
    --to=luis.machado@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nils-christian.kempke@intel.com \
    /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).