Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org, Tobias Burnus <burnus@net-b.de>,
		Ulrich Weigand <uweigand@de.ibm.com>,
		Jim Blandy <jimb@red-bean.com>,
	jimb@codesourcery.com
Subject: Re: [patch] static_kind -> bit0, bit1  [Re: [gdb] Fortran dynamic arrays]
Date: Fri, 26 Sep 2008 22:12:00 -0000	[thread overview]
Message-ID: <20080926221119.GC3814@adacore.com> (raw)
In-Reply-To: <20080926043810.GA1610@host0.dyn.jankratochvil.net>

> I agree "static_kind" is "discriminant" but not "artificial".  Artificial is
> just additional flag existing only for FIELDS of type TYPE_CODE_FUNC or type
> TYPE_CODE_METHOD:

Yes, I don't know why I was thinking that artificial was a discriminant
(meaning "no location").

> Moreover the split into the big union gets more complicated when we merge
> them.  Should I really rework the patch into the enum merging
> artificial+static_kind?

No that won't be necessary. I agree with Daniel that we should go with
your patch for now.  Improving the clarity of the discriminant can be
done separately.

> Sorry, a typo from the ChangeLog script
>   http://sourceware.org/ml/gdb-patches/2006-08/msg00195.html
> , put there at least a warning now:
>   warn "Extra directory" if $dfile=~m{(?:gdb|bfd|opcodes|libiberty)/};

No problem, please just remember to fix these before you commit.

> > > +      lower_bound = f77_get_lowerbound (type);
> > > +      if (lower_bound != 1)	/* Not the default.  */
> > > +	fprintf_filtered (stream, "%d:", lower_bound);
> > 
> > Here, it looks like  we're slightly modifying the behavior - if the lower
> > bound was undefined, then we're throwing an error when we used not to.
> 
> That was a dead code.  BOUND_FETCH_ERROR could never have been returned by
> f77_get_dynamic_lowerbound():
> BOUND_SIMPLE returns BOUND_FETCH_OK.
> BOUND_CANNOT_BE_DETERMINED already error()s itself and never returns.
> Other BOUND_* cases were never set.

Hmmm, you are right! So that piece was fine too.

> Another question is if BOUND_CANNOT_BE_DETERMINED should error() as
> currently does or if it rather should return BOUND_FETCH_ERROR.  But
> that decision is outside of the scope of my patch and changes the
> current GDB behavior.

Absolutely.

> > > +  if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
> > > +    {
> > > +      printfi_filtered (spaces, "upper bound undefined is %d\n",
> > > +			TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type));
> > > +      printfi_filtered (spaces, "lower bound undefined is %d\n",
> > > +			TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED (type));
> > > +    }
> > 
> > I think this is only repetitive, and shouldn't be displayed. The
> > artificial field value will be displayed a little later, and that
> > should be good enough.  No strong objection, though.
> 
> As I hope the "artificial" field may start to exist only for some types
> I tried to make the patch more abstract to the specific implementation of
> TYPE_ARRAY_{UPPER,LOWER}_BOUND_IS_UNDEFINED.  But no strong opinion on
> either way.

That's only my opinion too, and there is no real reason why my opinion
should count too. But to me, this function does a low-level dump of
our type structure, and thus should follow closely the implementation.
If we start to introduce a higher-level view of this type, I think
it can potentially be confusing.  For now, I would prefer to leave
that part out.

Your patch is approved with the few corrections I mentioned.
Thank you.

-- 
Joel


  reply	other threads:[~2008-09-26 22:12 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-15 15:06 [gdb] Fortran dynamic arrays Tobias Burnus
2008-08-18 11:12 ` Joel Brobecker
2008-08-18 15:54   ` Ulrich Weigand
2008-09-07 11:59 ` [patch] static_kind -> bit0, bit1 [Re: [gdb] Fortran dynamic arrays] Jan Kratochvil
2008-09-08 15:32   ` Tom Tromey
2008-09-08 17:27     ` Jan Kratochvil
2008-09-19 22:29       ` Joel Brobecker
2008-09-26 23:04         ` Tom Tromey
2008-09-27 14:53           ` Joel Brobecker
2008-09-19  6:04   ` Joel Brobecker
2008-09-22 15:25     ` Jan Kratochvil
2008-09-24 19:15       ` Joel Brobecker
2008-09-26  5:03         ` Jan Kratochvil
2008-09-26 22:12           ` Joel Brobecker [this message]
2008-10-02 22:13             ` [patch] Fortran obsolete bounds type [Re: [patch] static_kind -> bit0, bit1] Jan Kratochvil
2008-09-26 12:52         ` [patch] static_kind -> bit0, bit1 [Re: [gdb] Fortran dynamic arrays] Daniel Jacobowitz
2008-09-26 22:15           ` Joel Brobecker
2008-09-26 22:20             ` Daniel Jacobowitz
2008-09-19 22:13   ` Joel Brobecker
2008-09-26  5:06     ` Accessor macro wrappers removal [Re: [patch] static_kind -> bit0, bit1] Jan Kratochvil
2008-09-26 12:55       ` Daniel Jacobowitz
2008-10-02 20:59         ` Jan Kratochvil
2008-10-02 21:05           ` Daniel Jacobowitz
2008-09-26 23:15       ` Tom Tromey
2008-09-26 12:58     ` [patch] static_kind -> bit0, bit1 [Re: [gdb] Fortran dynamic arrays] Daniel Jacobowitz
     [not found]       ` <20081006200928.GD3588@adacore.com>
2008-10-06 20:26         ` Jan Kratochvil
2008-10-07 23:22         ` type/main_type/field size [Re: [patch] static_kind -> bit0, bit1] Jan Kratochvil
2008-10-08  3:32           ` Joel Brobecker
2008-10-08 23:56             ` Tom Tromey
2008-10-04 20:28     ` [patch] static_kind -> bit0, bit1 [Re: [gdb] Fortran dynamic arrays] Jan Kratochvil
2008-10-06 20:00       ` Joel Brobecker
2008-10-07 23:18         ` Jan Kratochvil
2008-10-08  3:28           ` Joel Brobecker
2008-10-08 12:54             ` Jan Kratochvil

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=20080926221119.GC3814@adacore.com \
    --to=brobecker@adacore.com \
    --cc=burnus@net-b.de \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=jimb@codesourcery.com \
    --cc=jimb@red-bean.com \
    --cc=uweigand@de.ibm.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