Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: Tom Tromey <tom@tromey.com>
Cc: abdul.b.ijaz@intel.com,
	"abdul.b.ijaz" <abijaz@ecsmtp.iul.intel.com>,
	gdb-patches@sourceware.org
Subject: Re: [PATCH 1/1] gdb: Fix arrays of variable length strings for FORTRAN
Date: Wed, 25 Aug 2021 09:56:36 +0100	[thread overview]
Message-ID: <20210825085636.GG2581@embecosm.com> (raw)
In-Reply-To: <87zgt7990i.fsf@tromey.com>

* Tom Tromey <tom@tromey.com> [2021-08-23 14:54:53 -0600]:

> >>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:
> 
> >> case TYPE_CODE_ARRAY:
> >> +    case TYPE_CODE_STRING:
> >> c_value_print_array (val, stream, recurse, options);
> >> break;
> 
> Andrew> I don't understand what part this change plays in this patch.  I can
> Andrew> see below how you're now creating values with TYPE_CODE_STRING instead
> Andrew> of TYPE_CODE_ARRAY, but then I'd expect these to be covered by the
> Andrew> existing handling of TYPE_CODE_STRING in
> Andrew> f_language::value_print_inner.
> 
> I wonder if this should go in generic_value_print instead.

generic_val_print_array doesn't print arrays of character type things
as a string, so I think having this change in c_value_print_inner
makes sense.

I did wonder if we should _also_ change generic_val_print though, as
this would catch any language that wasn't Fortran, C, or C++ that
called into generic_val_print and didn't already handle
TYPE_CODE_STRING.

However, that's only Modula2 and Pascal, both of which already handle
TYPE_CODE_ARRAY and do something similar to C's print character types
as a string, which leads me to think that maybe both of these
languages should be handling TYPE_CODE_STRING as an alias for
TYPE_CODE_ARRAY.

Given that language_defn::value_print_inner actually calls
c_value_print_inner, rather than generic_val_print, I do wonder if
some/all of c_value_print_inner could be moved into generic_val_print,
though that's clearly out of scope of this patch.

I'm also tempted to say that the Modula2 and Pascal changes are
optional, as that seems like an edge case (user debugging Fortran code
with the language forced to one of those two choices).

Thanks,
Andrew

  reply	other threads:[~2021-08-25  8:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-20 11:06 [PATCH 0/1] Fix variable length strings array " abdul.b.ijaz via Gdb-patches
2021-08-20 11:06 ` [PATCH 1/1] gdb: Fix arrays of variable length strings " abdul.b.ijaz via Gdb-patches
2021-08-20 15:52   ` Andrew Burgess
2021-08-23  8:47     ` Ijaz, Abdul B via Gdb-patches
2021-08-25  8:36       ` Andrew Burgess
2021-08-27  9:11         ` Ijaz, Abdul B via Gdb-patches
2021-08-23 20:54     ` Tom Tromey
2021-08-25  8:56       ` Andrew Burgess [this message]
2021-08-27 17:02         ` Tom Tromey
2021-12-29 11:31           ` Ijaz, Abdul B via Gdb-patches
2022-04-11 14:51             ` Ijaz, Abdul B via Gdb-patches
2022-04-15 16:33             ` Tom Tromey
2021-08-20 17:02   ` Andrew Burgess

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=20210825085636.GG2581@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=abdul.b.ijaz@intel.com \
    --cc=abijaz@ecsmtp.iul.intel.com \
    --cc=gdb-patches@sourceware.org \
    --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