From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29167 invoked by alias); 11 Oct 2007 08:56:12 -0000 Received: (qmail 29096 invoked by uid 22791); 11 Oct 2007 08:56:11 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate5.de.ibm.com (HELO mtagate5.de.ibm.com) (195.212.29.154) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 11 Oct 2007 08:56:06 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate5.de.ibm.com (8.13.8/8.13.8) with ESMTP id l9B8tds8424134 for ; Thu, 11 Oct 2007 08:55:39 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.5) with ESMTP id l9B8tdUg1573056 for ; Thu, 11 Oct 2007 10:55:39 +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 l9B8tcgn025878 for ; Thu, 11 Oct 2007 10:55:38 +0200 Received: from bbkeks.boeblingen.de.ibm.com (dyn-9-152-248-41.boeblingen.de.ibm.com [9.152.248.41]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l9B8tbUb025852 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 11 Oct 2007 10:55:38 +0200 Message-ID: <470DE4AC.2020101@de.ibm.com> Date: Thu, 11 Oct 2007 08:56:00 -0000 From: Markus Deuling User-Agent: Thunderbird 2.0.0.6 (X11/20070728) MIME-Version: 1.0 To: GDB Patches CC: Ulrich Weigand Subject: [rfc] [10/17] Get rid of current_gdbarch in p-lang.c Content-Type: multipart/mixed; boundary="------------040605040802000200010004" 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-10/txt/msg00272.txt.bz2 This is a multi-part message in MIME format. --------------040605040802000200010004 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Content-length: 377 Hi, this patch gets rid of some of the current_gdbarch's in p-lang.c Is this ok to commit? ChangeLog: * p-lang.c: Add new include objfiles.h. (pascal_create_fundamental_type): Use objfile->gdbarch to get at the current architecture. * Makefile.in (p-lang.o): Add dependency on objfile.h. -- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com --------------040605040802000200010004 Content-Type: text/plain; name="diff-p-lang" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diff-p-lang" Content-length: 5033 diff -urpN src/gdb/Makefile.in dev/gdb/Makefile.in --- src/gdb/Makefile.in 2007-10-11 08:30:21.000000000 +0200 +++ dev/gdb/Makefile.in 2007-10-11 09:30:33.000000000 +0200 @@ -2442,7 +2442,7 @@ p-exp.o: p-exp.c $(defs_h) $(gdb_string_ $(objfiles_h) $(block_h) p-lang.o: p-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ $(expression_h) $(parser_defs_h) $(language_h) $(p_lang_h) \ - $(valprint_h) $(value_h) + $(valprint_h) $(value_h) $(objfiles_h) posix-hdep.o: posix-hdep.c $(defs_h) $(gdb_string_h) $(gdb_select_h) ppcbug-rom.o: ppcbug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ $(serial_h) $(regcache_h) diff -urpN src/gdb/p-lang.c dev/gdb/p-lang.c --- src/gdb/p-lang.c 2007-10-09 11:33:24.000000000 +0200 +++ dev/gdb/p-lang.c 2007-10-11 09:32:35.000000000 +0200 @@ -31,7 +31,8 @@ #include "valprint.h" #include "value.h" #include - +#include "objfiles.h" + extern void _initialize_pascal_language (void); @@ -335,7 +336,7 @@ pascal_create_fundamental_type (struct o name "". When all the dust settles from the type reconstruction work, this should probably become an error. */ type = init_type (TYPE_CODE_INT, - gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT, + gdbarch_int_bit (objfile->gdbarch) / TARGET_CHAR_BIT, 0, "", objfile); warning (_("internal error: no Pascal fundamental type %d"), typeid); break; @@ -361,80 +362,80 @@ pascal_create_fundamental_type (struct o break; case FT_SHORT: type = init_type (TYPE_CODE_INT, - gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT, + gdbarch_short_bit (objfile->gdbarch) / TARGET_CHAR_BIT, 0, "integer", objfile); break; case FT_SIGNED_SHORT: type = init_type (TYPE_CODE_INT, - gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT, + gdbarch_short_bit (objfile->gdbarch) / TARGET_CHAR_BIT, 0, "integer", objfile); /* FIXME-fnf */ break; case FT_UNSIGNED_SHORT: type = init_type (TYPE_CODE_INT, - gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT, + gdbarch_short_bit (objfile->gdbarch) / TARGET_CHAR_BIT, TYPE_FLAG_UNSIGNED, "word", objfile); break; case FT_INTEGER: type = init_type (TYPE_CODE_INT, - gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT, + gdbarch_int_bit (objfile->gdbarch) / TARGET_CHAR_BIT, 0, "longint", objfile); break; case FT_SIGNED_INTEGER: type = init_type (TYPE_CODE_INT, - gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT, + gdbarch_int_bit (objfile->gdbarch) / TARGET_CHAR_BIT, 0, "longint", objfile); /* FIXME -fnf */ break; case FT_UNSIGNED_INTEGER: type = init_type (TYPE_CODE_INT, - gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT, + gdbarch_int_bit (objfile->gdbarch) / TARGET_CHAR_BIT, TYPE_FLAG_UNSIGNED, "cardinal", objfile); break; case FT_LONG: type = init_type (TYPE_CODE_INT, - gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT, + gdbarch_long_bit (objfile->gdbarch) / TARGET_CHAR_BIT, 0, "long", objfile); break; case FT_SIGNED_LONG: type = init_type (TYPE_CODE_INT, - gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT, + gdbarch_long_bit (objfile->gdbarch) / TARGET_CHAR_BIT, 0, "long", objfile); /* FIXME -fnf */ break; case FT_UNSIGNED_LONG: type = init_type (TYPE_CODE_INT, - gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT, + gdbarch_long_bit (objfile->gdbarch) / TARGET_CHAR_BIT, TYPE_FLAG_UNSIGNED, "unsigned long", objfile); break; case FT_LONG_LONG: type = init_type (TYPE_CODE_INT, gdbarch_long_long_bit - (current_gdbarch) / TARGET_CHAR_BIT, + (objfile->gdbarch) / TARGET_CHAR_BIT, 0, "long long", objfile); break; case FT_SIGNED_LONG_LONG: type = init_type (TYPE_CODE_INT, gdbarch_long_long_bit - (current_gdbarch) / TARGET_CHAR_BIT, + (objfile->gdbarch) / TARGET_CHAR_BIT, 0, "signed long long", objfile); break; case FT_UNSIGNED_LONG_LONG: type = init_type (TYPE_CODE_INT, gdbarch_long_long_bit - (current_gdbarch) / TARGET_CHAR_BIT, + (objfile->gdbarch) / TARGET_CHAR_BIT, TYPE_FLAG_UNSIGNED, "unsigned long long", objfile); break; case FT_FLOAT: type = init_type (TYPE_CODE_FLT, - gdbarch_float_bit (current_gdbarch) / TARGET_CHAR_BIT, + gdbarch_float_bit (objfile->gdbarch) / TARGET_CHAR_BIT, 0, "float", objfile); break; case FT_DBL_PREC_FLOAT: type = init_type (TYPE_CODE_FLT, - gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT, + gdbarch_double_bit (objfile->gdbarch) / TARGET_CHAR_BIT, 0, "double", objfile); break; case FT_EXT_PREC_FLOAT: type = init_type (TYPE_CODE_FLT, - gdbarch_long_double_bit (current_gdbarch) + gdbarch_long_double_bit (objfile->gdbarch) / TARGET_CHAR_BIT, 0, "extended", objfile); break; --------------040605040802000200010004--