This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Remove C/C++ relevant code in Fortran specific file.
- From: Tom Tromey <tromey at redhat dot com>
- To: Christoph Weinmann <christoph dot t dot weinmann at intel dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 24 Sep 2013 11:34:20 -0600
- Subject: Re: [PATCH] Remove C/C++ relevant code in Fortran specific file.
- Authentication-results: sourceware.org; auth=none
- References: <1380033831-22490-1-git-send-email-christoph dot t dot weinmann at intel dot com>
>>>>> "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