From: Tom Tromey <tromey@redhat.com>
To: Christoph Weinmann <christoph.t.weinmann@intel.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Remove C/C++ relevant code in Fortran specific file.
Date: Tue, 24 Sep 2013 17:39:00 -0000 [thread overview]
Message-ID: <87hadaktsz.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1380033831-22490-1-git-send-email-christoph.t.weinmann@intel.com> (Christoph Weinmann's message of "Tue, 24 Sep 2013 16:43:51 +0200")
>>>>> "Christoph" == Christoph Weinmann <christoph.t.weinmann@intel.com> writes:
Christoph> Remove code relevant for printing C/C++ Integer values in a
Christoph> Fortran specific file to unify printing of Fortran values.
Looks good. A question below, and a minor nit.
Christoph> --- a/gdb/f-valprint.c
Christoph> +++ b/gdb/f-valprint.c
Christoph> @@ -354,21 +354,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
Christoph> original_value, options, 0, stream);
Christoph> }
Christoph> else
Christoph> - {
Christoph> - val_print_type_code_int (type, valaddr + embedded_offset, stream);
Christoph> - /* C and C++ has no single byte int type, char is used instead.
Christoph> - Since we don't know whether the value is really intended to
Christoph> - be used as an integer or a character, print the character
Christoph> - equivalent as well. */
Christoph> - if (TYPE_LENGTH (type) == 1)
Christoph> - {
Christoph> - LONGEST c;
Christoph> -
Christoph> - fputs_filtered (" ", stream);
Christoph> - c = unpack_long (type, valaddr + embedded_offset);
Christoph> - LA_PRINT_CHAR ((unsigned char) c, type, stream);
Christoph> - }
Christoph> - }
Christoph> + val_print_type_code_int (type, valaddr + embedded_offset, stream);
Christoph> break;
I wonder whether the whole "if" can be removed and simply call
val_print_scalar_formatted.
It's not that important, though. This part is fine as-is.
Christoph> +# Check the printed output of small data types.
Christoph> +gdb_test "print oneByte" ".* = 1.*" "Print the value of a one byte sized Integer type."
Christoph> +
Christoph> +gdb_test "print twobytes" ".*2 = 2.*" "Print the value of a two bytes sized Integer type."
Christoph> +
Christoph> +gdb_test "print chvalue" ".*3 = \'a\'.*" "Print the value of a Character type."
Christoph> +
Christoph> +gdb_test "print logvalue" ".*4 = \.TRUE\..*" "Print the value of a Logical type."
These lines go over the line length limit and should be split.
The patch is ok with this fixed.
Tom
prev parent reply other threads:[~2013-09-24 17:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-24 14:44 Christoph Weinmann
2013-09-24 15:14 ` Weinmann, Christoph T
2013-09-24 17:39 ` Tom Tromey [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=87hadaktsz.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=christoph.t.weinmann@intel.com \
--cc=gdb-patches@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