From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4432 invoked by alias); 4 Dec 2003 22:37:42 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 4425 invoked from network); 4 Dec 2003 22:37:42 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 4 Dec 2003 22:37:42 -0000 Received: from redhat.com (toocool.toronto.redhat.com [172.16.14.72]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 9964780018E; Thu, 4 Dec 2003 17:37:41 -0500 (EST) Message-ID: <3FCFB735.80204@redhat.com> Date: Thu, 04 Dec 2003 22:37:00 -0000 From: "J. Johnston" Organization: Red Hat Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Cc: Kevin Buettner Subject: [RFA]: fix ia64 long double support Content-Type: multipart/mixed; boundary="------------020204050403010906030107" X-SW-Source: 2003-12/txt/msg00152.txt.bz2 This is a multi-part message in MIME format. --------------020204050403010906030107 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 738 Fix to a couple of problems. First of all, we aren't setting up a long double format for the architecture so it defaults to double when you try and print a long double value via gdb. Although the ia64 has a special long double format it specifies, this format is only valid for register values. Values in memory use the x86 extended float format which is 80 bits. Register long doubles are 82 bits (2 more bits of exponent). Anyway, this simple change fixes it so long doubles print correctly. Ok to commit? -- Jeff J. 2003-12-04 Jeff Johnston * ia64-tdep.c (ia64_gdbarch_init): Set up the gdbarch long double format to be the i387 extended float format which is used for long double's in memory. --------------020204050403010906030107 Content-Type: text/plain; name="ia64-long-double.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ia64-long-double.patch" Content-length: 852 Index: ia64-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/ia64-tdep.c,v retrieving revision 1.104 diff -u -p -r1.104 ia64-tdep.c --- ia64-tdep.c 17 Nov 2003 21:38:36 -0000 1.104 +++ ia64-tdep.c 4 Dec 2003 22:29:43 -0000 @@ -3361,6 +3361,11 @@ ia64_gdbarch_init (struct gdbarch_info i 0, "builtin_type_ia64_ext", NULL); TYPE_FLOATFORMAT (builtin_type_ia64_ext) = &floatformat_ia64_ext; + /* On the ia64, long double floats in memory are actually stored + in memory different than they are in registers. In memory, + they match the x86 extended float format which is 80-bits. */ + set_gdbarch_long_double_format (gdbarch, &floatformat_i387_ext); + set_gdbarch_short_bit (gdbarch, 16); set_gdbarch_int_bit (gdbarch, 32); set_gdbarch_long_bit (gdbarch, 64); --------------020204050403010906030107--