From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18054 invoked by alias); 8 Jun 2007 23:16:20 -0000 Received: (qmail 18045 invoked by uid 22791); 8 Jun 2007 23:16:19 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate7.de.ibm.com (HELO mtagate7.de.ibm.com) (195.212.29.156) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 08 Jun 2007 23:16:15 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate7.de.ibm.com (8.13.8/8.13.8) with ESMTP id l58NGDoo281166 for ; Fri, 8 Jun 2007 23:16:13 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 l58NGCw34042902 for ; Sat, 9 Jun 2007 01:16:12 +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 l58NGCR5017578 for ; Sat, 9 Jun 2007 01:16:12 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id l58NGCCu017575 for ; Sat, 9 Jun 2007 01:16:12 +0200 Message-Id: <200706082316.l58NGCCu017575@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Sat, 9 Jun 2007 01:16:12 +0200 Subject: [5/10] Add "explicit size" types to builtin_type To: gdb-patches@sourceware.org Date: Fri, 08 Jun 2007 23:16:00 -0000 From: "Ulrich Weigand" X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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/msg00117.txt.bz2 Hello, the builtin_type structure does not contain the builtin types that are supposedly independent of the gdbarch. However, as already noted in comments in gdbtypes.c, this isn't really true: those types contain pointer_type and reference_type fields caching pointer and reference types to those base types -- and those will always be platform-dependent. Thus the base types must be treated as platform-dependent as well. This patch adds all those missing types to the builtin_type structure. Bye, Ulrich ChangeLog: * gdbarch.h (struct builtin_type): New members builtin_int0, builtin_int8, builtin_uint8, builtin_int16, builtin_uint16, builtin_int32, builtin_uint32, builtin_int64, builtin_uint64, builtin_int128, builtin_uint128, builtin_ieee_single, builtin_ieee_double, builtin_i387_ext, builtin_m68881_ext, builtin_arm_ext, builtin_ia64_spill, builtin_ia64_quad. * gdbarch.c (gdbtypes_post_init): Initialize them. diff -urNp gdb-orig/gdb/gdbtypes.c gdb-head/gdb/gdbtypes.c --- gdb-orig/gdb/gdbtypes.c 2007-06-08 18:25:35.311859405 +0200 +++ gdb-head/gdb/gdbtypes.c 2007-06-08 18:25:42.417900011 +0200 @@ -3583,6 +3583,74 @@ gdbtypes_post_init (struct gdbarch *gdba TYPE_FLAG_UNSIGNED, "__bfd_vma", (struct objfile *) NULL); + + /* Explicit types. + + Even though all types below here do not themselves depend on the + architecture, we still provide per-architecture instances. This is + because their pointer_type and reference_type fields may refer to + types that *are* architecture specific. */ + + builtin_type->builtin_int0 = + init_type (TYPE_CODE_INT, 0 / 8, + 0, + "int0_t", (struct objfile *) NULL); + builtin_type->builtin_int8 = + init_type (TYPE_CODE_INT, 8 / 8, + 0, + "int8_t", (struct objfile *) NULL); + builtin_type->builtin_uint8 = + init_type (TYPE_CODE_INT, 8 / 8, + TYPE_FLAG_UNSIGNED, + "uint8_t", (struct objfile *) NULL); + builtin_type->builtin_int16 = + init_type (TYPE_CODE_INT, 16 / 8, + 0, + "int16_t", (struct objfile *) NULL); + builtin_type->builtin_uint16 = + init_type (TYPE_CODE_INT, 16 / 8, + TYPE_FLAG_UNSIGNED, + "uint16_t", (struct objfile *) NULL); + builtin_type->builtin_int32 = + init_type (TYPE_CODE_INT, 32 / 8, + 0, + "int32_t", (struct objfile *) NULL); + builtin_type->builtin_uint32 = + init_type (TYPE_CODE_INT, 32 / 8, + TYPE_FLAG_UNSIGNED, + "uint32_t", (struct objfile *) NULL); + builtin_type->builtin_int64 = + init_type (TYPE_CODE_INT, 64 / 8, + 0, + "int64_t", (struct objfile *) NULL); + builtin_type->builtin_uint64 = + init_type (TYPE_CODE_INT, 64 / 8, + TYPE_FLAG_UNSIGNED, + "uint64_t", (struct objfile *) NULL); + builtin_type->builtin_int128 = + init_type (TYPE_CODE_INT, 128 / 8, + 0, + "int128_t", (struct objfile *) NULL); + builtin_type->builtin_uint128 = + init_type (TYPE_CODE_INT, 128 / 8, + TYPE_FLAG_UNSIGNED, + "uint128_t", (struct objfile *) NULL); + + builtin_type->builtin_ieee_single + = build_flt (-1, "builtin_type_ieee_single", floatformats_ieee_single); + builtin_type->builtin_ieee_double + = build_flt (-1, "builtin_type_ieee_double", floatformats_ieee_double); + builtin_type->builtin_i387_ext + = build_flt (-1, "builtin_type_i387_ext", floatformats_i387_ext); + builtin_type->builtin_m68881_ext + = build_flt (-1, "builtin_type_m68881_ext", floatformats_m68881_ext); + builtin_type->builtin_arm_ext + = build_flt (-1, "builtin_type_arm_ext", floatformats_arm_ext); + builtin_type->builtin_ia64_spill + = build_flt (-1, "builtin_type_ia64_spill", floatformats_ia64_spill); + builtin_type->builtin_ia64_quad + = build_flt (-1, "builtin_type_ia64_quad", floatformats_ia64_quad); + return builtin_type; } diff -urNp gdb-orig/gdb/gdbtypes.h gdb-head/gdb/gdbtypes.h --- gdb-orig/gdb/gdbtypes.h 2007-06-08 18:25:35.356852928 +0200 +++ gdb-head/gdb/gdbtypes.h 2007-06-08 18:25:42.460893821 +0200 @@ -1034,6 +1034,38 @@ struct builtin_type struct type *builtin_bool; struct type *builtin_long_long; struct type *builtin_unsigned_long_long; + + + /* Explicit types. + + Even though all types below here do not themselves depend on the + architecture, we still provide per-architecture instances. This is + because their pointer_type and reference_type fields may refer to + types that *are* architecture specific. */ + + /* Explicit integer types - see C9X for naming scheme. + The "int0" is for when an architecture needs to describe a register + that has no size. */ + struct type *builtin_int0; + struct type *builtin_int8; + struct type *builtin_uint8; + struct type *builtin_int16; + struct type *builtin_uint16; + struct type *builtin_int32; + struct type *builtin_uint32; + struct type *builtin_int64; + struct type *builtin_uint64; + struct type *builtin_int128; + struct type *builtin_uint128; + + /* Explicit floating-point types. */ + struct type *builtin_ieee_single; + struct type *builtin_ieee_double; + struct type *builtin_i387_ext; + struct type *builtin_m68881_ext; + struct type *builtin_arm_ext; + struct type *builtin_ia64_spill; + struct type *builtin_ia64_quad; }; /* Return the type table for the specified architecture. */ -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com