From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15226 invoked by alias); 1 Mar 2005 22:13:29 -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 15179 invoked from network); 1 Mar 2005 22:13:24 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 1 Mar 2005 22:13:24 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j21MDOha021270 for ; Tue, 1 Mar 2005 17:13:24 -0500 Received: from zenia.home.redhat.com (sebastian-int.corp.redhat.com [172.16.52.221]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j21MDNK17991; Tue, 1 Mar 2005 17:13:23 -0500 To: gdb-patches@sources.redhat.com Subject: Re: [RFA] New GDB target iq2000 References: <20050222114141.GA18314@cygbert.vinschen.de> From: Jim Blandy Date: Tue, 01 Mar 2005 22:13:00 -0000 In-Reply-To: <20050222114141.GA18314@cygbert.vinschen.de> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-03/txt/msg00006.txt.bz2 Hi, Corinna. > +/* Function: gdbarch_init > + Initializer function for the iq2000 gdbarch vector. > + Called by gdbarch. Sets up the gdbarch vector(s) for this target. */ > + > +static struct gdbarch * > +iq2000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) > +{ > + struct gdbarch *gdbarch; > + > + /* Look up list for candidates - only one. */ > + arches = gdbarch_list_lookup_by_info (arches, &info); > + if (arches != NULL) > + return arches->gdbarch; > + > + gdbarch = gdbarch_alloc (&info, NULL); > + > + set_gdbarch_num_regs (gdbarch, E_NUM_REGS); > + set_gdbarch_num_pseudo_regs (gdbarch, 0); > + set_gdbarch_sp_regnum (gdbarch, E_SP_REGNUM); > + set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM); > + set_gdbarch_register_name (gdbarch, iq2000_register_name); > + set_gdbarch_address_to_pointer (gdbarch, iq2000_address_to_pointer); > + set_gdbarch_pointer_to_address (gdbarch, iq2000_pointer_to_address); > + set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT); > + set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT); > + set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT); > + set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT); > + set_gdbarch_long_long_bit (gdbarch, 8 * TARGET_CHAR_BIT); > + set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT); > + set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); > + set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); > + set_gdbarch_float_format (gdbarch, & floatformat_ieee_single_big); > + set_gdbarch_double_format (gdbarch, & floatformat_ieee_double_big); > + set_gdbarch_long_double_format (gdbarch, & floatformat_ieee_double_big); > + set_gdbarch_return_value (gdbarch, iq2000_return_value); > + set_gdbarch_breakpoint_from_pc (gdbarch, iq2000_breakpoint_from_pc); > + set_gdbarch_frame_args_skip (gdbarch, 0); > + set_gdbarch_skip_prologue (gdbarch, iq2000_skip_prologue); > + set_gdbarch_decr_pc_after_break (gdbarch, 0); > + set_gdbarch_inner_than (gdbarch, core_addr_lessthan); > + set_gdbarch_print_insn (gdbarch, print_insn_iq2000); > + set_gdbarch_register_type (gdbarch, iq2000_register_type); > + set_gdbarch_frame_align (gdbarch, iq2000_frame_align); > + set_gdbarch_unwind_sp (gdbarch, iq2000_unwind_sp); > + set_gdbarch_unwind_pc (gdbarch, iq2000_unwind_pc); > + set_gdbarch_unwind_dummy_id (gdbarch, iq2000_unwind_dummy_id); > + frame_base_set_default (gdbarch, &iq2000_frame_base); > + set_gdbarch_push_dummy_call (gdbarch, iq2000_push_dummy_call); > + > + gdbarch_init_osabi (info, gdbarch); > + > + frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer); > + frame_unwind_append_sniffer (gdbarch, iq2000_frame_sniffer); > + > + return gdbarch; > +} I think all the calls to set_gdbarch__bit can be left out, because they just re-state the default values. Same for decr_pc_after_break, no? +static enum return_value_convention +iq2000_return_value (struct gdbarch *gdbarch, struct type *type, + struct regcache *regcache, + void *readbuf, const void *writebuf) +{ + if (iq2000_use_struct_convention (type)) + return RETURN_VALUE_STRUCT_CONVENTION; + if (writebuf) + iq2000_store_return_value (type, regcache, writebuf); + else if (readbuf) + iq2000_extract_return_value (type, regcache, readbuf); + return RETURN_VALUE_REGISTER_CONVENTION; +} The other return_value implementations I've seen allow one to pass both a readbuf and a writebuf, and do the read before the write. I can't find any place where it's actually used this way, but it seems to be allowed by the interface. In any case, it's easy enough to make iq2000_return_value behave like the others.