From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13249 invoked by alias); 10 Dec 2003 00:11:27 -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 13232 invoked from network); 10 Dec 2003 00:11:26 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 10 Dec 2003 00:11:26 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id hBA0BP208861 for ; Tue, 9 Dec 2003 19:11:25 -0500 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 hBA0BOb05243; Tue, 9 Dec 2003 19:11:24 -0500 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id hBA0BN625749; Tue, 9 Dec 2003 16:11:23 -0800 Message-ID: <3FD664AB.40805@redhat.com> Date: Wed, 10 Dec 2003 00:11:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Anil Paranjape CC: gdb-patches@sources.redhat.com Subject: Re: Patch for Bug in GDB Simulator for h8300h targets References: <69595093233BB547BB70CF5E492B63F20324E882@sohm.kpit.com> In-Reply-To: <69595093233BB547BB70CF5E492B63F20324E882@sohm.kpit.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-12/txt/msg00281.txt.bz2 Anil Paranjape wrote: > Hi, > > I have found one bug in simulator while debugging h8300h target in GDB. > > ************************** test.s *********************************** > .h8300h > .section .text > .global _start > _start: > mov #0xFFEFC0,er7 > mov.l er6,@-er7 > mov.l er7,er6 > mov.l @er7+,er6 > _exit: > sleep > bra _exit > .end > ********************************************************************** > Above code is compiled with following command, > h8300-elf-gcc -mh -nostartfiles -Wa,-gdwarf2 -o test.out test.s > > When test.out is loaded in GDB simulator, the first insn at _start gets executed properly. > But after executing "mov.l er6,@-er7" insn, value of er7 becomes 0x3EFBC instead of 0xFFEFBC. > > The address range for H8300H targets is defined as 18 bits. > But actually it is 24 bits, same as of H8300S targets. Can you elaborate on what you mean by "actually"? You mean the chip implements 24 bit addressing, even though it is specified for 18? That's a pretty radical difference. I almost wonder whether this would be regarded as an "undocumented feature". It isn't clear that we should deviate from the published spec without at least consulting the manufacturer. > > Following is a patch which fixes this bug, > > --- sim-main.h.orig Tue Dec 9 16:25:16 2003 > +++ sim-main.h Tue Dec 9 16:25:44 2003 > @@ -27,7 +27,7 @@ > /* avolkov: > Next 2 macros are ugly for any workstation, but while they're work. > Memory size MUST be configurable. */ > -#define H8300H_MSIZE (1 << 18) > +#define H8300H_MSIZE (1 << 24) > #define H8300S_MSIZE (1 << 24) > > #define CSIZE 1024 > > Regards, > Anil Paranjpe >