From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17784 invoked by alias); 17 Nov 2007 20:56:02 -0000 Received: (qmail 17764 invoked by uid 22791); 17 Nov 2007 20:56:01 -0000 X-Spam-Check-By: sourceware.org Received: from ug-out-1314.google.com (HELO ug-out-1314.google.com) (66.249.92.173) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 17 Nov 2007 20:55:59 +0000 Received: by ug-out-1314.google.com with SMTP id o2so1060053uge for ; Sat, 17 Nov 2007 12:55:56 -0800 (PST) Received: by 10.67.30.13 with SMTP id h13mr1488726ugj.1195332956410; Sat, 17 Nov 2007 12:55:56 -0800 (PST) Received: from ?192.168.2.6? ( [90.193.94.130]) by mx.google.com with ESMTPS id k30sm10320827ugc.2007.11.17.12.55.54 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 17 Nov 2007 12:55:55 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v752.3) To: gdb-patches@sourceware.org Message-Id: <6E63F9C5-BBBE-4C8D-8FCB-21B6ECF18580@gmail.com> Content-Type: multipart/mixed; boundary=Apple-Mail-20-129903349 Cc: "fortran@gcc.gnu.org List" Subject: Name of Fortran intrinsic types From: FX Coudert Date: Sat, 17 Nov 2007 20:56:00 -0000 X-Mailer: Apple Mail (2.752.3) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-11/txt/msg00354.txt.bz2 --Apple-Mail-20-129903349 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-length: 865 Hi all, This is my first patch submission for gdb (I received confirmation of my copyright assignment a week ago). It's short and I hope it's straightforward: for intrinsic Fortran types (here, real and complex types), I think we should use the name the compiler produced, instead of trying to be clever. The rationale is that this allows us to output Fortran names for the types, e.g. "real(kind=4)", instead gdb-specific, non-Fortran names (e.g. "int4"). The reason for doing that instead of simply replacing the format (currently "int%d") in gdb is that we have no way, in general, to know the kind of the variable in gdb, so it's better to simply trust the compiler! Built and regtested on x86_64-linux (there are a fair number of FAILures in the testsuite, but none in the Fortran area, so maybe it's the normal state?). Thanks, FX --Apple-Mail-20-129903349 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name=gdb-types.ChangeLog Content-Disposition: attachment; filename=gdb-types.ChangeLog Content-length: 214 2007-11-17 Francois-Xavier Coudert * f-typeprint.c (print_equivalent_f77_float_type): Remove function. (f_type_print_base): Output the type names directly for real and complex types. --Apple-Mail-20-129903349 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name=gdb-types.diff Content-Disposition: attachment; filename=gdb-types.diff Content-length: 1939 Index: f-typeprint.c =================================================================== RCS file: /cvs/src/src/gdb/f-typeprint.c,v retrieving revision 1.19 diff -p -u -r1.19 f-typeprint.c --- f-typeprint.c 23 Aug 2007 18:08:31 -0000 1.19 +++ f-typeprint.c 17 Nov 2007 20:33:47 -0000 @@ -39,9 +39,6 @@ static void f_type_print_args (struct type *, struct ui_file *); #endif -static void print_equivalent_f77_float_type (int level, struct type *, - struct ui_file *); - static void f_type_print_varspec_suffix (struct type *, struct ui_file *, int, int, int); @@ -254,17 +251,6 @@ f_type_print_varspec_suffix (struct type } } -static void -print_equivalent_f77_float_type (int level, struct type *type, - struct ui_file *stream) -{ - /* Override type name "float" and make it the - appropriate real. XLC stupidly outputs -12 as a type - for real when it really should be outputting -18 */ - - fprintfi_filtered (level, stream, "real*%d", TYPE_LENGTH (type)); -} - /* Print the name of the type (or the ultimate pointer target, function value or array element), or the description of a structure or union. @@ -301,10 +287,7 @@ f_type_print_base (struct type *type, st if ((show <= 0) && (TYPE_NAME (type) != NULL)) { - if (TYPE_CODE (type) == TYPE_CODE_FLT) - print_equivalent_f77_float_type (level, type, stream); - else - fputs_filtered (TYPE_NAME (type), stream); + fputs_filtered (TYPE_NAME (type), stream); return; } @@ -365,14 +348,6 @@ f_type_print_base (struct type *type, st goto default_case; break; - case TYPE_CODE_COMPLEX: - fprintfi_filtered (level, stream, "complex*%d", TYPE_LENGTH (type)); - break; - - case TYPE_CODE_FLT: - print_equivalent_f77_float_type (level, type, stream); - break; - case TYPE_CODE_STRING: /* Strings may have dynamic upperbounds (lengths) like arrays. */ --Apple-Mail-20-129903349--