From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6735 invoked by alias); 8 Jun 2007 10:26:30 -0000 Received: (qmail 6718 invoked by uid 22791); 8 Jun 2007 10:26:26 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate6.de.ibm.com (HELO mtagate6.de.ibm.com) (195.212.29.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 08 Jun 2007 10:26:17 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate6.de.ibm.com (8.13.8/8.13.8) with ESMTP id l58AQEZ5228294 for ; Fri, 8 Jun 2007 10:26:14 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l58AQELc4137144 for ; Fri, 8 Jun 2007 12:26:14 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l58AQDVI006764 for ; Fri, 8 Jun 2007 12:26:14 +0200 Received: from [9.152.248.39] (dyn-9-152-248-39.boeblingen.de.ibm.com [9.152.248.39]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l58AQCor006722 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 8 Jun 2007 12:26:13 +0200 Message-ID: <46692E72.7090004@de.ibm.com> Date: Fri, 08 Jun 2007 10:26:00 -0000 From: Markus Deuling User-Agent: Thunderbird 1.5.0.10 (X11/20070301) MIME-Version: 1.0 To: GDB Patches CC: Ulrich Weigand Subject: [rfc] [2/2] Remove macros TARGET_{FLOAT,DOUBLE,LONG_DOUBLE}_{BIT|FORMAT} Content-Type: multipart/mixed; boundary="------------080708060406090400020409" 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-06/txt/msg00106.txt.bz2 This is a multi-part message in MIME format. --------------080708060406090400020409 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 2862 Hello, this patch removes following macros from gdbarch.sh: * TARGET_FLOAT_BIT * TARGET_FLOAT_FORMAT * TARGET_DOUBLE_BIT * TARGET_DOUBLE_FORMAT * TARGET_LONG_DOUBLE_BIT * TARGET_LONG_DOUBLE_FORMAT ChangeLog: * gdbarch.sh (TARGET_FLOAT_BIT): Replace by gdbarch_float_bit. * p-lang.c (pascal_create_fundamental_type): Likewise. * objc-lang.c (objc_create_fundamental_type): Likewise. * mdebugread.c (_initialize_mdebugread): Likewise. * m2-lang.c (m2_create_fundamental_type) (_initialize_m2_language): Likewise. * gdbtypes.c (build_gdbtypes): Likewise. * f-lang.c (f_create_fundamental_type, build_fortran_types): Likewise. * doublest.c (floatformat_from_length): Likewise. * c-lang.c (c_create_fundamental_type): Likewise. * ada-lang.c (ada_create_fundamental_type) (ada_language_arch_info): Likewise. * gdbarch.sh (TARGET_FLOAT_FORMAT): Replace by gdbarch_float_format. * value.c (unpack_double): Likewise (comment). * gdbtypes.c (build_gdbtypes): Likewise. * doublest.c (floatformat_from_length): Likewise. * gdbarch.sh (TARGET_DOUBLE_BIT): Replace by gdbarch_double_bit. * valarith.c (value_binop): Likewise. * p-lang.c (pascal_create_fundamental_type): Likewise. * objc-lang.c (objc_create_fundamental_type): Likewise. * mdebugread.c (_initialize_mdebugread): Likewise. * m2-lang.c (m2_create_fundamental_type): Likewise. * gdbtypes.c (build_gdbtypes): Likewise. * f-lang.c (f_create_fundamental_type, build_fortran_types): Likewise. * doublest.c (floatformat_from_length): Likewise. * cris-tdep.c (cris_gdbarch_init): Likewise (comment). * c-lang.c (c_create_fundamental_type): Likewise. * ada-lex.l (processReal): Likewise. * ada-lang.c (ada_create_fundamental_type) (ada_language_arch_info): Likewise. * gdbarch.sh (TARGET_DOUBLE_FORMAT): Replace by gdbarch_double_format. * value.c (unpack_double): Likewise (comment). * gdbtypes.c (build_gdbtypes): Likewise. * doublest.c (floatformat_from_length): Likewise. * gdbarch.sh (TARGET_LONG_DOUBLE_BIT): Replace by gdbarch_long_double_bit. * p-lang.c (pascal_create_fundamental_type): Likewise. * objc-lang.c (objc_create_fundamental_type): Likewise. * m2-lang.c (m2_create_fundamental_type): Likewise. * gdbtypes.c (build_gdbtypes): Likewise. * f-lang.c (f_create_fundamental_type, build_fortran_types): Likewise. * doublest.c (floatformat_from_length): Likewise. * c-lang.c (c_create_fundamental_type): Likewise. * ada-lex.l (processReal): Likewise. * ada-lang.c (ada_create_fundamental_type) (ada_language_arch_info): Likewise. * gdbarch.sh (TARGET_LONG_DOUBLE_FORMAT): Replace by gdbarch_long_double_format. * gdbtypes.c (build_gdbtypes): Likewise. * doublest.c (floatformat_from_length): Likewise. * gdbarch.c, gdbarch.h: Regenerate. Is this ok to commit? -- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com --------------080708060406090400020409 Content-Type: text/plain; name="diff-remove-FLOAT" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diff-remove-FLOAT" Content-length: 29749 diff -urN src.orig/gdb/ada-lang.c src.1/gdb/ada-lang.c --- src.orig/gdb/ada-lang.c 2007-06-08 09:20:29.000000000 +0200 +++ src.1/gdb/ada-lang.c 2007-06-08 09:40:49.000000000 +0200 @@ -10287,17 +10287,18 @@ break; case FT_FLOAT: type = init_type (TYPE_CODE_FLT, - TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + gdbarch_float_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "float", objfile); break; case FT_DBL_PREC_FLOAT: type = init_type (TYPE_CODE_FLT, - TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "long_float", objfile); break; case FT_EXT_PREC_FLOAT: type = init_type (TYPE_CODE_FLT, - TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, + gdbarch_long_double_bit (current_gdbarch) + / TARGET_CHAR_BIT, 0, "long_long_float", objfile); break; } @@ -10345,18 +10346,21 @@ init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT, 0, "character", (struct objfile *) NULL); lai->primitive_type_vector [ada_primitive_type_float] = - init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + init_type (TYPE_CODE_FLT, + gdbarch_float_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "float", (struct objfile *) NULL); lai->primitive_type_vector [ada_primitive_type_double] = - init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, - 0, "long_float", (struct objfile *) NULL); + init_type (TYPE_CODE_FLT, + gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT, + 0, "long_float", (struct objfile *) NULL); lai->primitive_type_vector [ada_primitive_type_long_long] = init_type (TYPE_CODE_INT, gdbarch_long_long_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "long_long_integer", (struct objfile *) NULL); lai->primitive_type_vector [ada_primitive_type_long_double] = - init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, - 0, "long_long_float", (struct objfile *) NULL); + init_type (TYPE_CODE_FLT, + gdbarch_long_double_bit (current_gdbarch) / TARGET_CHAR_BIT, + 0, "long_long_float", (struct objfile *) NULL); lai->primitive_type_vector [ada_primitive_type_natural] = init_type (TYPE_CODE_INT, gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT, diff -urN src.orig/gdb/ada-lex.l src.1/gdb/ada-lex.l --- src.orig/gdb/ada-lex.l 2007-06-08 09:20:29.000000000 +0200 +++ src.1/gdb/ada-lex.l 2007-06-08 09:43:09.000000000 +0200 @@ -376,9 +376,11 @@ sscanf (num0, DOUBLEST_SCAN_FORMAT, &yylval.typed_val_float.dval); yylval.typed_val_float.type = type_float (); - if (sizeof(DOUBLEST) >= TARGET_DOUBLE_BIT / TARGET_CHAR_BIT) + if (sizeof(DOUBLEST) >= gdbarch_double_bit (current_gdbarch) + / TARGET_CHAR_BIT) yylval.typed_val_float.type = type_double (); - if (sizeof(DOUBLEST) >= TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT) + if (sizeof(DOUBLEST) >= gdbarch_long_double_bit (current_gdbarch) + / TARGET_CHAR_BIT) yylval.typed_val_float.type = type_long_double (); return FLOAT; diff -urN src.orig/gdb/c-lang.c src.1/gdb/c-lang.c --- src.orig/gdb/c-lang.c 2007-06-08 09:20:29.000000000 +0200 +++ src.1/gdb/c-lang.c 2007-06-08 09:41:51.000000000 +0200 @@ -313,41 +313,49 @@ break; case FT_FLOAT: type = init_type (TYPE_CODE_FLT, - TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + gdbarch_float_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "float", objfile); break; case FT_DBL_PREC_FLOAT: type = init_type (TYPE_CODE_FLT, - TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "double", objfile); break; case FT_EXT_PREC_FLOAT: type = init_type (TYPE_CODE_FLT, - TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, + gdbarch_long_double_bit (current_gdbarch) + / TARGET_CHAR_BIT, 0, "long double", objfile); break; case FT_COMPLEX: type = init_type (TYPE_CODE_FLT, - 2 * TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + 2 * gdbarch_float_bit (current_gdbarch) + / TARGET_CHAR_BIT, 0, "complex float", objfile); TYPE_TARGET_TYPE (type) - = init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + = init_type (TYPE_CODE_FLT, + gdbarch_float_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "float", objfile); break; case FT_DBL_PREC_COMPLEX: type = init_type (TYPE_CODE_FLT, - 2 * TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + 2 * gdbarch_double_bit (current_gdbarch) + / TARGET_CHAR_BIT, 0, "complex double", objfile); TYPE_TARGET_TYPE (type) - = init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + = init_type (TYPE_CODE_FLT, + gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "double", objfile); break; case FT_EXT_PREC_COMPLEX: type = init_type (TYPE_CODE_FLT, - 2 * TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, + 2 * gdbarch_long_double_bit (current_gdbarch) + / TARGET_CHAR_BIT, 0, "complex long double", objfile); TYPE_TARGET_TYPE (type) - = init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, + = init_type (TYPE_CODE_FLT, + gdbarch_long_double_bit (current_gdbarch) + / TARGET_CHAR_BIT, 0, "long double", objfile); break; case FT_TEMPLATE_ARG: diff -urN src.orig/gdb/cris-tdep.c src.1/gdb/cris-tdep.c --- src.orig/gdb/cris-tdep.c 2007-05-31 19:31:37.000000000 +0200 +++ src.1/gdb/cris-tdep.c 2007-06-08 09:21:16.000000000 +0200 @@ -4107,7 +4107,7 @@ register is. */ set_gdbarch_double_bit (gdbarch, 64); - /* The default definition of a long double is 2 * TARGET_DOUBLE_BIT, + /* The default definition of a long double is 2 * gdbarch_double_bit, which means we have to set this explicitly. */ set_gdbarch_long_double_bit (gdbarch, 64); diff -urN src.orig/gdb/doublest.c src.1/gdb/doublest.c --- src.orig/gdb/doublest.c 2007-05-31 19:11:18.000000000 +0200 +++ src.1/gdb/doublest.c 2007-06-08 09:31:16.000000000 +0200 @@ -724,20 +724,24 @@ floatformat_from_length (int len) { const struct floatformat *format; - if (len * TARGET_CHAR_BIT == TARGET_FLOAT_BIT) - format = TARGET_FLOAT_FORMAT[gdbarch_byte_order (current_gdbarch)]; - else if (len * TARGET_CHAR_BIT == TARGET_DOUBLE_BIT) - format = TARGET_DOUBLE_FORMAT[gdbarch_byte_order (current_gdbarch)]; - else if (len * TARGET_CHAR_BIT == TARGET_LONG_DOUBLE_BIT) - format = TARGET_LONG_DOUBLE_FORMAT[gdbarch_byte_order (current_gdbarch)]; + if (len * TARGET_CHAR_BIT == gdbarch_float_bit (current_gdbarch)) + format = gdbarch_float_format (current_gdbarch) + [gdbarch_byte_order (current_gdbarch)]; + else if (len * TARGET_CHAR_BIT == gdbarch_double_bit (current_gdbarch)) + format = gdbarch_double_format (current_gdbarch) + [gdbarch_byte_order (current_gdbarch)]; + else if (len * TARGET_CHAR_BIT == gdbarch_long_double_bit (current_gdbarch)) + format = gdbarch_long_double_format (current_gdbarch) + [gdbarch_byte_order (current_gdbarch)]; /* On i386 the 'long double' type takes 96 bits, while the real number of used bits is only 80, both in processor and in memory. The code below accepts the real bit size. */ - else if ((TARGET_LONG_DOUBLE_FORMAT != NULL) + else if ((gdbarch_long_double_format (current_gdbarch) != NULL) && (len * TARGET_CHAR_BIT == - TARGET_LONG_DOUBLE_FORMAT[0]->totalsize)) - format = TARGET_LONG_DOUBLE_FORMAT[gdbarch_byte_order (current_gdbarch)]; + gdbarch_long_double_format (current_gdbarch)[0]->totalsize)) + format = gdbarch_long_double_format (current_gdbarch) + [gdbarch_byte_order (current_gdbarch)]; else format = NULL; if (format == NULL) diff -urN src.orig/gdb/f-lang.c src.1/gdb/f-lang.c --- src.orig/gdb/f-lang.c 2007-06-08 09:20:30.000000000 +0200 +++ src.1/gdb/f-lang.c 2007-06-08 09:37:37.000000000 +0200 @@ -353,39 +353,42 @@ break; case FT_FLOAT: type = init_type (TYPE_CODE_FLT, - TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + gdbarch_float_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "real", objfile); break; case FT_DBL_PREC_FLOAT: type = init_type (TYPE_CODE_FLT, - TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "real*8", objfile); break; case FT_FLOAT_DECIMAL: type = init_type (TYPE_CODE_FLT, - TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "floating decimal", objfile); break; case FT_EXT_PREC_FLOAT: type = init_type (TYPE_CODE_FLT, - TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, + gdbarch_long_double_bit (current_gdbarch) + / TARGET_CHAR_BIT, 0, "real*16", objfile); break; case FT_COMPLEX: type = init_type (TYPE_CODE_COMPLEX, - 2 * TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + 2 * gdbarch_float_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "complex*8", objfile); TYPE_TARGET_TYPE (type) = builtin_type_f_real; break; case FT_DBL_PREC_COMPLEX: type = init_type (TYPE_CODE_COMPLEX, - 2 * TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + 2 * gdbarch_double_bit (current_gdbarch) + / TARGET_CHAR_BIT, 0, "complex*16", objfile); TYPE_TARGET_TYPE (type) = builtin_type_f_real_s8; break; case FT_EXT_PREC_COMPLEX: type = init_type (TYPE_CODE_COMPLEX, - 2 * TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, + 2 * gdbarch_long_double_bit (current_gdbarch) + / TARGET_CHAR_BIT, 0, "complex*32", objfile); TYPE_TARGET_TYPE (type) = builtin_type_f_real_s16; break; @@ -531,28 +534,33 @@ TYPE_FLAG_UNSIGNED, "logical*4", (struct objfile *) NULL); builtin_type_f_real = - init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + init_type (TYPE_CODE_FLT, + gdbarch_float_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "real", (struct objfile *) NULL); builtin_type_f_real_s8 = - init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + init_type (TYPE_CODE_FLT, + gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "real*8", (struct objfile *) NULL); builtin_type_f_real_s16 = - init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, + init_type (TYPE_CODE_FLT, + gdbarch_long_double_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "real*16", (struct objfile *) NULL); builtin_type_f_complex_s8 = - init_type (TYPE_CODE_COMPLEX, 2 * TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + init_type (TYPE_CODE_COMPLEX, + 2 * gdbarch_float_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "complex*8", (struct objfile *) NULL); TYPE_TARGET_TYPE (builtin_type_f_complex_s8) = builtin_type_f_real; builtin_type_f_complex_s16 = - init_type (TYPE_CODE_COMPLEX, 2 * TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + init_type (TYPE_CODE_COMPLEX, + 2 * gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "complex*16", (struct objfile *) NULL); TYPE_TARGET_TYPE (builtin_type_f_complex_s16) = builtin_type_f_real_s8; @@ -561,7 +569,8 @@ complex*32 data type */ builtin_type_f_complex_s32 = - init_type (TYPE_CODE_COMPLEX, 2 * TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, + init_type (TYPE_CODE_COMPLEX, + 2 * gdbarch_long_double_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "complex*32", (struct objfile *) NULL); TYPE_TARGET_TYPE (builtin_type_f_complex_s32) = builtin_type_f_real_s16; diff -urN src.orig/gdb/gdbarch.c src.1/gdb/gdbarch.c --- src.orig/gdb/gdbarch.c 2007-06-08 09:20:30.000000000 +0200 +++ src.1/gdb/gdbarch.c 2007-06-08 09:21:16.000000000 +0200 @@ -373,7 +373,7 @@ struct gdbarch_tdep *tdep) { /* NOTE: The new architecture variable is named ``current_gdbarch'' - so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to + so that macros such as gdbarch_double_bit, when expanded, refer to the current local architecture and not the previous global architecture. This ensures that the new architectures initial values are not influenced by the previous architecture. Once @@ -873,19 +873,9 @@ fprintf_unfiltered (file, "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n", (long) current_gdbarch->deprecated_use_struct_convention); -#ifdef TARGET_DOUBLE_BIT - fprintf_unfiltered (file, - "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n", - XSTRING (TARGET_DOUBLE_BIT)); -#endif fprintf_unfiltered (file, "gdbarch_dump: double_bit = %s\n", paddr_d (current_gdbarch->double_bit)); -#ifdef TARGET_DOUBLE_FORMAT - fprintf_unfiltered (file, - "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n", - XSTRING (TARGET_DOUBLE_FORMAT)); -#endif fprintf_unfiltered (file, "gdbarch_dump: double_format = %s\n", pformat (current_gdbarch->double_format)); @@ -952,19 +942,9 @@ fprintf_unfiltered (file, "gdbarch_dump: fetch_tls_load_module_address = <0x%lx>\n", (long) current_gdbarch->fetch_tls_load_module_address); -#ifdef TARGET_FLOAT_BIT - fprintf_unfiltered (file, - "gdbarch_dump: TARGET_FLOAT_BIT # %s\n", - XSTRING (TARGET_FLOAT_BIT)); -#endif fprintf_unfiltered (file, "gdbarch_dump: float_bit = %s\n", paddr_d (current_gdbarch->float_bit)); -#ifdef TARGET_FLOAT_FORMAT - fprintf_unfiltered (file, - "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n", - XSTRING (TARGET_FLOAT_FORMAT)); -#endif fprintf_unfiltered (file, "gdbarch_dump: float_format = %s\n", pformat (current_gdbarch->float_format)); @@ -1030,19 +1010,9 @@ fprintf_unfiltered (file, "gdbarch_dump: long_bit = %s\n", paddr_d (current_gdbarch->long_bit)); -#ifdef TARGET_LONG_DOUBLE_BIT - fprintf_unfiltered (file, - "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n", - XSTRING (TARGET_LONG_DOUBLE_BIT)); -#endif fprintf_unfiltered (file, "gdbarch_dump: long_double_bit = %s\n", paddr_d (current_gdbarch->long_double_bit)); -#ifdef TARGET_LONG_DOUBLE_FORMAT - fprintf_unfiltered (file, - "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n", - XSTRING (TARGET_LONG_DOUBLE_FORMAT)); -#endif fprintf_unfiltered (file, "gdbarch_dump: long_double_format = %s\n", pformat (current_gdbarch->long_double_format)); diff -urN src.orig/gdb/gdbarch.h src.1/gdb/gdbarch.h --- src.orig/gdb/gdbarch.h 2007-06-08 09:20:30.000000000 +0200 +++ src.1/gdb/gdbarch.h 2007-06-08 09:21:16.000000000 +0200 @@ -112,57 +112,21 @@ extern int gdbarch_float_bit (struct gdbarch *gdbarch); extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit); -#if !defined (GDB_TM_FILE) && defined (TARGET_FLOAT_BIT) -#error "Non multi-arch definition of TARGET_FLOAT_BIT" -#endif -#if !defined (TARGET_FLOAT_BIT) -#define TARGET_FLOAT_BIT (gdbarch_float_bit (current_gdbarch)) -#endif extern const struct floatformat ** gdbarch_float_format (struct gdbarch *gdbarch); extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floatformat ** float_format); -#if !defined (GDB_TM_FILE) && defined (TARGET_FLOAT_FORMAT) -#error "Non multi-arch definition of TARGET_FLOAT_FORMAT" -#endif -#if !defined (TARGET_FLOAT_FORMAT) -#define TARGET_FLOAT_FORMAT (gdbarch_float_format (current_gdbarch)) -#endif extern int gdbarch_double_bit (struct gdbarch *gdbarch); extern void set_gdbarch_double_bit (struct gdbarch *gdbarch, int double_bit); -#if !defined (GDB_TM_FILE) && defined (TARGET_DOUBLE_BIT) -#error "Non multi-arch definition of TARGET_DOUBLE_BIT" -#endif -#if !defined (TARGET_DOUBLE_BIT) -#define TARGET_DOUBLE_BIT (gdbarch_double_bit (current_gdbarch)) -#endif extern const struct floatformat ** gdbarch_double_format (struct gdbarch *gdbarch); extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct floatformat ** double_format); -#if !defined (GDB_TM_FILE) && defined (TARGET_DOUBLE_FORMAT) -#error "Non multi-arch definition of TARGET_DOUBLE_FORMAT" -#endif -#if !defined (TARGET_DOUBLE_FORMAT) -#define TARGET_DOUBLE_FORMAT (gdbarch_double_format (current_gdbarch)) -#endif extern int gdbarch_long_double_bit (struct gdbarch *gdbarch); extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_double_bit); -#if !defined (GDB_TM_FILE) && defined (TARGET_LONG_DOUBLE_BIT) -#error "Non multi-arch definition of TARGET_LONG_DOUBLE_BIT" -#endif -#if !defined (TARGET_LONG_DOUBLE_BIT) -#define TARGET_LONG_DOUBLE_BIT (gdbarch_long_double_bit (current_gdbarch)) -#endif extern const struct floatformat ** gdbarch_long_double_format (struct gdbarch *gdbarch); extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struct floatformat ** long_double_format); -#if !defined (GDB_TM_FILE) && defined (TARGET_LONG_DOUBLE_FORMAT) -#error "Non multi-arch definition of TARGET_LONG_DOUBLE_FORMAT" -#endif -#if !defined (TARGET_LONG_DOUBLE_FORMAT) -#define TARGET_LONG_DOUBLE_FORMAT (gdbarch_long_double_format (current_gdbarch)) -#endif /* For most targets, a pointer on the target and its representation as an address in GDB have the same size and "look the same". For such a diff -urN src.orig/gdb/gdbarch.sh src.1/gdb/gdbarch.sh --- src.orig/gdb/gdbarch.sh 2007-06-08 09:20:30.000000000 +0200 +++ src.1/gdb/gdbarch.sh 2007-06-08 09:21:16.000000000 +0200 @@ -394,12 +394,12 @@ # Each format describes both the big and little endian layouts (if # useful). -v:TARGET_FLOAT_BIT:int:float_bit:::8 * sizeof (float):4*TARGET_CHAR_BIT::0 -v:TARGET_FLOAT_FORMAT:const struct floatformat **:float_format:::::floatformats_ieee_single::pformat (current_gdbarch->float_format) -v:TARGET_DOUBLE_BIT:int:double_bit:::8 * sizeof (double):8*TARGET_CHAR_BIT::0 -v:TARGET_DOUBLE_FORMAT:const struct floatformat **:double_format:::::floatformats_ieee_double::pformat (current_gdbarch->double_format) -v:TARGET_LONG_DOUBLE_BIT:int:long_double_bit:::8 * sizeof (long double):8*TARGET_CHAR_BIT::0 -v:TARGET_LONG_DOUBLE_FORMAT:const struct floatformat **:long_double_format:::::floatformats_ieee_double::pformat (current_gdbarch->long_double_format) +v::int:float_bit:::8 * sizeof (float):4*TARGET_CHAR_BIT::0 +v::const struct floatformat **:float_format:::::floatformats_ieee_single::pformat (current_gdbarch->float_format) +v::int:double_bit:::8 * sizeof (double):8*TARGET_CHAR_BIT::0 +v::const struct floatformat **:double_format:::::floatformats_ieee_double::pformat (current_gdbarch->double_format) +v::int:long_double_bit:::8 * sizeof (long double):8*TARGET_CHAR_BIT::0 +v::const struct floatformat **:long_double_format:::::floatformats_ieee_double::pformat (current_gdbarch->long_double_format) # For most targets, a pointer on the target and its representation as an # address in GDB have the same size and "look the same". For such a @@ -1348,7 +1348,7 @@ struct gdbarch_tdep *tdep) { /* NOTE: The new architecture variable is named \`\`current_gdbarch'' - so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to + so that macros such as gdbarch_double_bit, when expanded, refer to the current local architecture and not the previous global architecture. This ensures that the new architectures initial values are not influenced by the previous architecture. Once diff -urN src.orig/gdb/gdbtypes.c src.1/gdb/gdbtypes.c --- src.orig/gdb/gdbtypes.c 2007-06-08 09:20:30.000000000 +0200 +++ src.1/gdb/gdbtypes.c 2007-06-08 09:27:24.000000000 +0200 @@ -3466,22 +3466,26 @@ gdbarch_long_long_bit (current_gdbarch) / TARGET_CHAR_BIT, TYPE_FLAG_UNSIGNED, "unsigned long long", (struct objfile *) NULL); - builtin_type_float = build_flt (TARGET_FLOAT_BIT, "float", - TARGET_FLOAT_FORMAT); - builtin_type_double = build_flt (TARGET_DOUBLE_BIT, "double", - TARGET_DOUBLE_FORMAT); - builtin_type_long_double = build_flt (TARGET_LONG_DOUBLE_BIT, "long double", - TARGET_LONG_DOUBLE_FORMAT); + builtin_type_float = build_flt (gdbarch_float_bit (current_gdbarch), "float", + gdbarch_float_format (current_gdbarch)); + builtin_type_double = build_flt (gdbarch_double_bit (current_gdbarch), + "double", + gdbarch_double_format (current_gdbarch)); + builtin_type_long_double = build_flt (gdbarch_long_double_bit + (current_gdbarch), + "long double", + gdbarch_long_double_format + (current_gdbarch)); builtin_type_complex = - init_type (TYPE_CODE_COMPLEX, 2 * TARGET_FLOAT_BIT / TARGET_CHAR_BIT, - 0, - "complex", (struct objfile *) NULL); + init_type (TYPE_CODE_COMPLEX, + 2 * gdbarch_float_bit (current_gdbarch) / TARGET_CHAR_BIT, + 0, "complex", (struct objfile *) NULL); TYPE_TARGET_TYPE (builtin_type_complex) = builtin_type_float; builtin_type_double_complex = - init_type (TYPE_CODE_COMPLEX, 2 * TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, - 0, - "double complex", (struct objfile *) NULL); + init_type (TYPE_CODE_COMPLEX, + 2 * gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT, + 0, "double complex", (struct objfile *) NULL); TYPE_TARGET_TYPE (builtin_type_double_complex) = builtin_type_double; builtin_type_string = init_type (TYPE_CODE_STRING, TARGET_CHAR_BIT / TARGET_CHAR_BIT, diff -urN src.orig/gdb/m2-lang.c src.1/gdb/m2-lang.c --- src.orig/gdb/m2-lang.c 2007-06-08 09:20:30.000000000 +0200 +++ src.1/gdb/m2-lang.c 2007-06-08 09:38:22.000000000 +0200 @@ -310,41 +310,45 @@ break; case FT_FLOAT: type = init_type (TYPE_CODE_FLT, - TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + gdbarch_float_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "float", objfile); break; case FT_DBL_PREC_FLOAT: type = init_type (TYPE_CODE_FLT, - TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "double", objfile); break; case FT_FLOAT_DECIMAL: type = init_type (TYPE_CODE_FLT, - TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "floating decimal", objfile); break; case FT_EXT_PREC_FLOAT: type = init_type (TYPE_CODE_FLT, - TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, + gdbarch_long_double_bit (current_gdbarch) + / TARGET_CHAR_BIT, 0, "long double", objfile); break; case FT_COMPLEX: type = init_type (TYPE_CODE_COMPLEX, - 2 * TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + 2 * gdbarch_float_bit (current_gdbarch) + / TARGET_CHAR_BIT, 0, "complex", objfile); TYPE_TARGET_TYPE (type) = m2_create_fundamental_type (objfile, FT_FLOAT); break; case FT_DBL_PREC_COMPLEX: type = init_type (TYPE_CODE_COMPLEX, - 2 * TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + 2 * gdbarch_double_bit (current_gdbarch) + / TARGET_CHAR_BIT, 0, "double complex", objfile); TYPE_TARGET_TYPE (type) = m2_create_fundamental_type (objfile, FT_DBL_PREC_FLOAT); break; case FT_EXT_PREC_COMPLEX: type = init_type (TYPE_CODE_COMPLEX, - 2 * TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, + 2 * gdbarch_long_double_bit (current_gdbarch) + / TARGET_CHAR_BIT, 0, "long double complex", objfile); TYPE_TARGET_TYPE (type) = m2_create_fundamental_type (objfile, FT_EXT_PREC_FLOAT); @@ -460,7 +464,8 @@ TYPE_FLAG_UNSIGNED, "CARDINAL", (struct objfile *) NULL); builtin_type_m2_real = - init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + init_type (TYPE_CODE_FLT, + gdbarch_float_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "REAL", (struct objfile *) NULL); builtin_type_m2_char = diff -urN src.orig/gdb/mdebugread.c src.1/gdb/mdebugread.c --- src.orig/gdb/mdebugread.c 2007-06-08 09:20:30.000000000 +0200 +++ src.1/gdb/mdebugread.c 2007-06-08 09:39:09.000000000 +0200 @@ -4841,22 +4841,22 @@ "adr_64", (struct objfile *) NULL); TYPE_TARGET_TYPE (mdebug_type_adr_64) = mdebug_type_void; mdebug_type_float = - init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT, - 0, - "float", (struct objfile *) NULL); + init_type (TYPE_CODE_FLT, + gdbarch_float_bit (current_gdbarch) / TARGET_CHAR_BIT, + 0, "float", (struct objfile *) NULL); mdebug_type_double = - init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, - 0, - "double", (struct objfile *) NULL); + init_type (TYPE_CODE_FLT, + gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT, + 0, "double", (struct objfile *) NULL); mdebug_type_complex = - init_type (TYPE_CODE_COMPLEX, 2 * TARGET_FLOAT_BIT / TARGET_CHAR_BIT, - 0, - "complex", (struct objfile *) NULL); + init_type (TYPE_CODE_COMPLEX, + 2 * gdbarch_float_bit (current_gdbarch) / TARGET_CHAR_BIT, + 0, "complex", (struct objfile *) NULL); TYPE_TARGET_TYPE (mdebug_type_complex) = mdebug_type_float; mdebug_type_double_complex = - init_type (TYPE_CODE_COMPLEX, 2 * TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, - 0, - "double complex", (struct objfile *) NULL); + init_type (TYPE_CODE_COMPLEX, + 2 * gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT, + 0, "double complex", (struct objfile *) NULL); TYPE_TARGET_TYPE (mdebug_type_double_complex) = mdebug_type_double; /* Is a "string" the way btString means it the same as TYPE_CODE_STRING? @@ -4878,7 +4878,7 @@ mdebug_type_float_dec = init_type (TYPE_CODE_ERROR, - TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "floating decimal", (struct objfile *) NULL); diff -urN src.orig/gdb/objc-lang.c src.1/gdb/objc-lang.c --- src.orig/gdb/objc-lang.c 2007-06-08 09:20:30.000000000 +0200 +++ src.1/gdb/objc-lang.c 2007-06-08 09:39:37.000000000 +0200 @@ -550,17 +550,19 @@ break; case FT_FLOAT: type = init_type (TYPE_CODE_FLT, - TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + gdbarch_float_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "float", objfile); break; case FT_DBL_PREC_FLOAT: type = init_type (TYPE_CODE_FLT, - TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + gdbarch_double_bit (current_gdbarch) + / TARGET_CHAR_BIT, 0, "double", objfile); break; case FT_EXT_PREC_FLOAT: type = init_type (TYPE_CODE_FLT, - TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, + gdbarch_long_double_bit (current_gdbarch) + / TARGET_CHAR_BIT, 0, "long double", objfile); break; } diff -urN src.orig/gdb/p-lang.c src.1/gdb/p-lang.c --- src.orig/gdb/p-lang.c 2007-06-08 09:20:30.000000000 +0200 +++ src.1/gdb/p-lang.c 2007-06-08 09:40:12.000000000 +0200 @@ -376,17 +376,18 @@ break; case FT_FLOAT: type = init_type (TYPE_CODE_FLT, - TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + gdbarch_float_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "float", objfile); break; case FT_DBL_PREC_FLOAT: type = init_type (TYPE_CODE_FLT, - TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT, 0, "double", objfile); break; case FT_EXT_PREC_FLOAT: type = init_type (TYPE_CODE_FLT, - TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, + gdbarch_long_double_bit (current_gdbarch) + / TARGET_CHAR_BIT, 0, "extended", objfile); break; } diff -urN src.orig/gdb/valarith.c src.1/gdb/valarith.c --- src.orig/gdb/valarith.c 2007-06-08 09:20:30.000000000 +0200 +++ src.1/gdb/valarith.c 2007-06-08 09:21:16.000000000 +0200 @@ -808,8 +808,8 @@ /* If either arg was long double, make sure that value is also long double. */ - if (TYPE_LENGTH (type1) * 8 > TARGET_DOUBLE_BIT - || TYPE_LENGTH (type2) * 8 > TARGET_DOUBLE_BIT) + if (TYPE_LENGTH (type1) * 8 > gdbarch_double_bit (current_gdbarch) + || TYPE_LENGTH (type2) * 8 > gdbarch_double_bit (current_gdbarch)) val = allocate_value (builtin_type_long_double); else val = allocate_value (builtin_type_double); diff -urN src.orig/gdb/value.c src.1/gdb/value.c --- src.orig/gdb/value.c 2007-05-31 19:11:18.000000000 +0200 +++ src.1/gdb/value.c 2007-06-08 09:21:16.000000000 +0200 @@ -1138,7 +1138,7 @@ only in a non-portable way. Fixing the portability problem wouldn't help since the VAX floating-point code is also badly bit-rotten. The target needs to add definitions for the - methods TARGET_FLOAT_FORMAT and TARGET_DOUBLE_FORMAT - these + methods gdbarch_float_format and gdbarch_double_format - these exactly describe the target floating-point format. The problem here is that the corresponding floatformat_vax_f and floatformat_vax_d values these methods should be set to are --------------080708060406090400020409--