From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24729 invoked by alias); 19 Jun 2007 05:24:28 -0000 Received: (qmail 24715 invoked by uid 22791); 19 Jun 2007 05:24:27 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate1.de.ibm.com (HELO mtagate1.de.ibm.com) (195.212.29.150) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 19 Jun 2007 05:24:24 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.8/8.13.8) with ESMTP id l5J5OLsv150096 for ; Tue, 19 Jun 2007 05:24:21 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 l5J5OL383915916 for ; Tue, 19 Jun 2007 07:24:21 +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 l5J5OK4b005907 for ; Tue, 19 Jun 2007 07:24:20 +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 l5J5OJRI005884 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 19 Jun 2007 07:24:20 +0200 Message-ID: <46776832.8070907@de.ibm.com> Date: Tue, 19 Jun 2007 05:24: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] Replace macro BELIEVE_PCC_PROMOTION Content-Type: multipart/mixed; boundary="------------000508010000010408030104" 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/msg00364.txt.bz2 This is a multi-part message in MIME format. --------------000508010000010408030104 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 480 Hello, this patch replaces macro BELIEVE_PCC_PROMOTION by gdbarch_believe_pcc_promotion. ChangeLog: * gdbarch.sh (BELIEVE_PCC_PROMOTION): Replace by gdbarch_believe_pcc_promotion. * stabsread.c (define_symbol): Likewise. Remove unnecessary definition. * coffread.c (process_coff_symbol): Remove unnecessary code. * gdbarch.c, gdbarch.h: Regenerate. Is this ok to commit ? Not much left :-D -- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com --------------000508010000010408030104 Content-Type: text/plain; name="diff-remove-BELIEVE_PCC_PROMOTION" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diff-remove-BELIEVE_PCC_PROMOTION" Content-length: 5112 diff -urN src/gdb/coffread.c dev/gdb/coffread.c --- src/gdb/coffread.c 2007-06-19 05:22:04.000000000 +0200 +++ dev/gdb/coffread.c 2007-06-19 05:49:32.000000000 +0200 @@ -1561,25 +1561,6 @@ case C_ARG: SYMBOL_CLASS (sym) = LOC_ARG; add_symbol_to_list (sym, &local_symbols); -#if !defined (BELIEVE_PCC_PROMOTION) - if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG) - { - /* If PCC says a parameter is a short or a char, - aligned on an int boundary, realign it to the - "little end" of the int. */ - struct type *temptype; - temptype = lookup_fundamental_type (current_objfile, - FT_INTEGER); - if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (temptype) - && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT - && 0 == SYMBOL_VALUE (sym) % TYPE_LENGTH (temptype)) - { - SYMBOL_VALUE (sym) += - TYPE_LENGTH (temptype) - - TYPE_LENGTH (SYMBOL_TYPE (sym)); - } - } -#endif break; case C_REGPARM: @@ -1587,26 +1568,6 @@ SYMBOL_VALUE (sym) = gdbarch_sdb_reg_to_regnum (current_gdbarch, cs->c_value); add_symbol_to_list (sym, &local_symbols); -#if !defined (BELIEVE_PCC_PROMOTION) - /* FIXME: This should retain the current type, since it's just - a register value. gnu@adobe, 26Feb93 */ - { - /* If PCC says a parameter is a short or a char, - it is really an int. */ - struct type *temptype; - temptype = - lookup_fundamental_type (current_objfile, FT_INTEGER); - if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (temptype) - && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT) - { - SYMBOL_TYPE (sym) = - (TYPE_UNSIGNED (SYMBOL_TYPE (sym)) - ? lookup_fundamental_type (current_objfile, - FT_UNSIGNED_INTEGER) - : temptype); - } - } -#endif break; case C_TPDEF: diff -urN src/gdb/gdbarch.c dev/gdb/gdbarch.c --- src/gdb/gdbarch.c 2007-06-19 05:22:04.000000000 +0200 +++ dev/gdb/gdbarch.c 2007-06-19 05:46:35.000000000 +0200 @@ -673,11 +673,6 @@ fprintf_unfiltered (file, "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n", (long) current_gdbarch->adjust_breakpoint_address); -#ifdef BELIEVE_PCC_PROMOTION - fprintf_unfiltered (file, - "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n", - XSTRING (BELIEVE_PCC_PROMOTION)); -#endif fprintf_unfiltered (file, "gdbarch_dump: believe_pcc_promotion = %s\n", paddr_d (current_gdbarch->believe_pcc_promotion)); diff -urN src/gdb/gdbarch.h dev/gdb/gdbarch.h --- src/gdb/gdbarch.h 2007-06-19 05:22:04.000000000 +0200 +++ dev/gdb/gdbarch.h 2007-06-19 05:46:26.000000000 +0200 @@ -320,12 +320,6 @@ extern int gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch); extern void set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, int believe_pcc_promotion); -#if !defined (GDB_TM_FILE) && defined (BELIEVE_PCC_PROMOTION) -#error "Non multi-arch definition of BELIEVE_PCC_PROMOTION" -#endif -#if !defined (BELIEVE_PCC_PROMOTION) -#define BELIEVE_PCC_PROMOTION (gdbarch_believe_pcc_promotion (current_gdbarch)) -#endif typedef int (gdbarch_convert_register_p_ftype) (int regnum, struct type *type); extern int gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type); diff -urN src/gdb/gdbarch.sh dev/gdb/gdbarch.sh --- src/gdb/gdbarch.sh 2007-06-19 05:22:04.000000000 +0200 +++ dev/gdb/gdbarch.sh 2007-06-19 05:46:19.000000000 +0200 @@ -481,7 +481,7 @@ # setjmp/longjmp support. F::int:get_longjmp_target:struct frame_info *frame, CORE_ADDR *pc:frame, pc # -v:=:int:believe_pcc_promotion::::::: +v::int:believe_pcc_promotion::::::: # f::int:convert_register_p:int regnum, struct type *type:regnum, type:0:generic_convert_register_p::0 f::void:register_to_value:struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf:frame, regnum, type, buf:0 diff -urN src/gdb/stabsread.c dev/gdb/stabsread.c --- src/gdb/stabsread.c 2007-06-19 05:22:05.000000000 +0200 +++ dev/gdb/stabsread.c 2007-06-19 05:48:04.000000000 +0200 @@ -162,15 +162,6 @@ static const char vptr_name[] = "_vptr$"; static const char vb_name[] = "_vb$"; -/* Define this as 1 if a pcc declaration of a char or short argument - gives the correct address. Otherwise assume pcc gives the - address of the corresponding int, which is not the same on a - big-endian machine. */ - -#if !defined (BELIEVE_PCC_PROMOTION) -#define BELIEVE_PCC_PROMOTION 0 -#endif - static void invalid_cpp_abbrev_complaint (const char *arg1) { @@ -971,10 +962,11 @@ } /* If it's gcc-compiled, if it says `short', believe it. */ - if (processing_gcc_compilation || BELIEVE_PCC_PROMOTION) + if (processing_gcc_compilation + || gdbarch_believe_pcc_promotion (current_gdbarch)) break; - if (!BELIEVE_PCC_PROMOTION) + if (!gdbarch_believe_pcc_promotion (current_gdbarch)) { /* This is the signed type which arguments get promoted to. */ static struct type *pcc_promotion_type; --------------000508010000010408030104--