From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6901 invoked by alias); 10 Dec 2003 08:29:45 -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 6883 invoked from network); 10 Dec 2003 08:29:38 -0000 Received: from unknown (HELO sohm.kpit.com) (203.129.230.82) by sources.redhat.com with SMTP; 10 Dec 2003 08:29:38 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: Patch for Bug in GDB Simulator for h8300h targets Date: Wed, 10 Dec 2003 08:29:00 -0000 Message-ID: <69595093233BB547BB70CF5E492B63F20324EBD3@sohm.kpit.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Anil Paranjape" To: "Michael Snyder" Cc: X-SW-Source: 2003-12/txt/msg00288.txt.bz2 Hi Michael, The maximum memory that can be addressed by H8300H series controllers( H8/3= 048,H8/3069 etc.) is 16 Mbytes i.e. from 0x000000 to 0xFFFFFF. So when H8300H target is selec= ted in simulator, it should be able to address 16 Mbytes of memory(24 bit a= ddressing) but simulator allocates only=20 256 Kbytes of memory(18 bit addressing).=20 Please refer to section 1.3 of H8300H series programming manual, http://www.eu.renesas.com/documents/mpumcu/pdf/h8300h_p.pdf Regards, Anil -----Original Message----- From: Michael Snyder [mailto:msnyder@redhat.com] Sent: Wednesday, December 10, 2003 5:41 AM To: Anil Paranjape Cc: gdb-patches@sources.redhat.com Subject: Re: Patch for Bug in GDB Simulator for h8300h targets Anil Paranjape wrote: > Hi, >=20 > I have found one bug in simulator while debugging h8300h target in GDB.=20 >=20 > ************************** 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 >=20 > When test.out is loaded in GDB simulator, the first insn at _start gets e= xecuted properly.=20 > But after executing "mov.l er6,@-er7" insn, value of er7 becomes 0x3EFBC = instead of 0xFFEFBC. >=20 > The address range for H8300H targets is defined as 18 bits.=20 > 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. >=20 > Following is a patch which fixes this bug, >=20 > --- 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) >=20 > #define CSIZE 1024 >=20 > Regards, > Anil Paranjpe >=20