From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18123 invoked by alias); 15 Apr 2004 16:04:39 -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 18085 invoked from network); 15 Apr 2004 16:04:37 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 15 Apr 2004 16:04:37 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 099782B9C; Thu, 15 Apr 2004 12:04:33 -0400 (EDT) Message-ID: <407EB290.3000900@gnu.org> Date: Thu, 15 Apr 2004 16:04:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20040217 MIME-Version: 1.0 To: Randolph Chung Cc: gdb-patches@sources.redhat.com Subject: Re: [patch/resend/rfa] (1/4) Cleanup static function usage in hppa-tdep.c References: <20040414062438.GJ31873@tausq.org> In-Reply-To: <20040414062438.GJ31873@tausq.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-04/txt/msg00313.txt.bz2 > 2004-04-13 Randolph Chung > > * hppa-tdep.c (hppa_reg_struct_has_addr, hppa_skip_prologue, > hppa_skip_trampoline_code, hppa_in_solib_call_trampoline, > hppa_in_solib_return_trampoline, hppa_cannot_store_register, > hppa_smash_text_address, hppa_target_read_pc, hppa_target_write_pc): > Remove forward declaration and make static. > (hppa_reg_struct_has_addr): Rename to hppa_use_struct_convention. > (hppa_gdbarch_init): Set use_struct_convention. > > Index: hppa-tdep.c > =================================================================== > RCS file: /cvs/src/src/gdb/hppa-tdep.c,v > retrieving revision 1.143 > diff -u -p -r1.143 hppa-tdep.c > --- hppa-tdep.c 11 Apr 2004 04:20:51 -0000 1.143 > +++ hppa-tdep.c 14 Apr 2004 05:01:21 -0000 > @@ -121,17 +123,8 @@ static void internalize_unwinds (struct > static void record_text_segment_lowaddr (bfd *, asection *, void *); > /* FIXME: brobecker 2002-11-07: We will likely be able to make the > following functions static, once we hppa is partially multiarched. */ > -int hppa_reg_struct_has_addr (int gcc_p, struct type *type); > -CORE_ADDR hppa_skip_prologue (CORE_ADDR pc); > -CORE_ADDR hppa_skip_trampoline_code (CORE_ADDR pc); > -int hppa_in_solib_call_trampoline (CORE_ADDR pc, char *name); > -int hppa_in_solib_return_trampoline (CORE_ADDR pc, char *name); > int hppa_pc_requires_run_before_use (CORE_ADDR pc); > int hppa_instruction_nullified (void); > -int hppa_cannot_store_register (int regnum); > -CORE_ADDR hppa_smash_text_address (CORE_ADDR addr); > -CORE_ADDR hppa_target_read_pc (ptid_t ptid); > -void hppa_target_write_pc (CORE_ADDR v, ptid_t ptid); Yes, definitly, avoid the duplication (these date back to pre ISO-C days). Just not this: > -int > -hppa_reg_struct_has_addr (int gcc_p, struct type *type) > +static int > +hppa_use_struct_convention (int gcc_p, struct type *type) > + set_gdbarch_use_struct_convention (gdbarch, hppa_use_struct_convention); > + use_struct_convention shouldn't be needed -> "struct_return" provides a superset of its functionality. I suspect that the function reg_struct_has_addr can instead simply be removed? Minus use_struct_convention, it's ok to commit, Andrew