From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26782 invoked by alias); 22 Sep 2003 17:27:25 -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 26773 invoked from network); 22 Sep 2003 17:27:24 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 22 Sep 2003 17:27:24 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h8MHRL117563 for ; Mon, 22 Sep 2003 13:27:22 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h8MHRKD29069 for ; Mon, 22 Sep 2003 13:27:20 -0400 Received: from cygbert.vinschen.de (vpn50-51.rdu.redhat.com [172.16.50.51]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id h8MHRIw16588 for ; Mon, 22 Sep 2003 10:27:19 -0700 Received: by cygbert.vinschen.de (Postfix, from userid 500) id 5440E580A8; Mon, 22 Sep 2003 19:27:17 +0200 (CEST) Date: Mon, 22 Sep 2003 17:27:00 -0000 From: Corinna Vinschen To: gdb-patches@sources.redhat.com Subject: Re: RFA - PATCH - Support H8/300H and H8S Normal Mode for GDB Message-ID: <20030922172717.GA19544@cygbert.vinschen.de> Reply-To: gdb-patches@sources.redhat.com Mail-Followup-To: gdb-patches@sources.redhat.com References: <69595093233BB547BB70CF5E492B63F201F7240B@sohm.kpit.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <69595093233BB547BB70CF5E492B63F201F7240B@sohm.kpit.com> User-Agent: Mutt/1.4.1i X-SW-Source: 2003-09/txt/msg00470.txt.bz2 On Mon, Sep 15, 2003 at 02:25:20PM +0530, Shrinivas Atre wrote: > Hi, > > The attached patch enables debugging and simulation of H8/300H and H8S > Normal Mode binaries in GDB. > > Is that OK for mainline and 6.0 branch ? Do you have an FSF copyright assignment? AFAIK you need that. > --- src/gdb/config/h8300/tm-h8300.h.orig Mon Sep 15 10:46:23 2003 > +++ src/gdb/config/h8300/tm-h8300.h Mon Sep 15 13:32:23 2003 > @@ -26,6 +26,7 @@ > GDB_TARGET_IS_H8300 in remote-e7000.c */ > extern int h8300hmode; > extern int h8300smode; > +extern int NormalMode; /* 1 - Normal Mode , 0 - Advanced mode */ Please don't use UpperCase but only lower case and underscore for variable names. This variable should be named normal_mode. In this very case, the variable is extern so the name should be much less ambiguous. Probably "h8300_normal_mode" would fit. > - case bfd_mach_h8300h: > case bfd_mach_h8300hn: > + NormalMode = 1; > + h8300sxmode = 0; > + h8300smode = 0; > + h8300hmode = 1; > + set_gdbarch_num_regs (gdbarch, 13); > + set_gdbarch_num_pseudo_regs (gdbarch, 1); > + set_gdbarch_ecoff_reg_to_regnum (gdbarch, h8300_dbg_reg_to_regnum); > + set_gdbarch_dwarf_reg_to_regnum (gdbarch, h8300_dbg_reg_to_regnum); > + set_gdbarch_dwarf2_reg_to_regnum (gdbarch, h8300_dbg_reg_to_regnum); > + set_gdbarch_stab_reg_to_regnum (gdbarch, h8300_dbg_reg_to_regnum); > + set_gdbarch_register_name (gdbarch, h8300_register_name); > + set_gdbarch_ptr_bit (gdbarch, 2 * TARGET_CHAR_BIT); > + set_gdbarch_addr_bit (gdbarch, 2 * TARGET_CHAR_BIT); > + set_gdbarch_extract_return_value (gdbarch, h8300h_extract_return_value); > + set_gdbarch_store_return_value (gdbarch, h8300h_store_return_value); > + set_gdbarch_print_insn (gdbarch, print_insn_h8300h); > + break; > + case bfd_mach_h8300h: > + NormalMode = 0; > h8300sxmode = 0; > h8300smode = 0; > h8300hmode = 1; Is it necessary to duplicate all set_gdbarch_XXX calls? Wouldn't it be more clear to set "h8300_normal_mode" separately to show that it's the same machine, just another mode? E. g. case bfd_mach_h8300h: case bfd_mach_h8300hn: if (info.bfd_arch_info->mach) h8300_normal_mode = 1; > @@ -510,6 +510,7 @@ enum { POLL_QUIT_INTERVAL = 0x80000 }; > > int h8300hmode = 0; > int h8300smode = 0; > +int NormalMode = 0; As above, "h8300_normal_mode" would be better. Otherwise it looks ok but I guess we need a word from the h8300 sim expert. Michael? Corinna -- Corinna Vinschen Cygwin Developer Red Hat, Inc.