Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Richard Bunt <richard.bunt@arm.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org, nd@arm.com
Subject: Re: [PATCH v2] Logical short circuiting with argument lists
Date: Wed, 12 Sep 2018 08:16:00 -0000	[thread overview]
Message-ID: <2fd31db3-e0f7-262b-6b30-bd7a78cbabbf@arm.com> (raw)
In-Reply-To: <87mustueua.fsf@tromey.com>



On 09/07/2018 11:23 PM, Tom Tromey wrote:
>>>>>> "Richard" == Richard Bunt <richard.bunt@arm.com> writes:


> 
> I wonder if we really want this to error in the case where the symbol
> isn't found.  But I suppose it is necessary for your patch to work.
> 
> I tend to think it is fine; I couldn't think of a plausible,
> non-pathological way that I would want to use the non-erroring behavior.

If I understand correctly the concern here is that the evaluation will
report an error if the symbol is not found, even if it is supposed to be
evaluated in a lazy manner. I considered a similar issue when testing
with the following expression:

print k .OR. array(1,2,3,4)

where k == .TRUE. and array only has 3 dimensions. The debugger still
reports that this is invalid even though the array access is not needed
for the truth value. I considered this to be acceptable as this code
wouldn't compile anyway and I would rather it failed fast than at some
point later (when k becomes false). I believe a similar justification 
holds for the case where array is an invalid symbol.

> 
> Though, another option is to do this in a fortran-specific way.

Are you able to provide some more details on this approach please?

> 
> Richard> +	gdb_test "p .TRUE. .OR. binary_string($range1) .OR. truth_table($range2, 1)" \
> 
> For some of the tests -- I'm afraid I didn't enumerate them -- you will
> need to supply a different (and unique) test name to gdb_test, because
> there is a rule against tests having parenthesized text at the end of
> their name:
> 
> https://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Do_not_use_.22tail_parentheses.22_on_test_messages
> 
> Tom
> 

Based on the discussion with Simon I understand that there is no issue
here. However, if I had used a space between the array symbol name
and the parenthesizes this would have been a problem. This is useful to
know.

Missing comments, style errors and non-idiomatic code have been fixed
in v3.

Many thanks for the comments,

Rich.


  parent reply	other threads:[~2018-09-12  8:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-16 16:03 Richard Bunt
2018-09-04  8:26 ` [PING][PATCH " Richard Bunt
2018-09-07 22:23 ` [PATCH " Tom Tromey
2018-09-07 22:29   ` Simon Marchi
2018-09-07 22:34     ` Simon Marchi
2018-09-07 22:36     ` Tom Tromey
2018-09-08 21:25   ` Simon Marchi
2018-09-12  8:16   ` Richard Bunt [this message]
     [not found]     ` <87pnxjj688.fsf@tromey.com>
2018-09-12 13:04       ` Pedro Alves
2018-09-15 21:03         ` Tom Tromey
2018-09-17 18:04       ` Richard Bunt

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=2fd31db3-e0f7-262b-6b30-bd7a78cbabbf@arm.com \
    --to=richard.bunt@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nd@arm.com \
    --cc=tom@tromey.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