Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Patch for Bug in GDB Simulator for h8300h targets
@ 2003-12-09 11:51 Anil Paranjape
  2003-12-10  0:11 ` Michael Snyder
  0 siblings, 1 reply; 6+ messages in thread
From: Anil Paranjape @ 2003-12-09 11:51 UTC (permalink / raw)
  To: gdb-patches

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.

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Patch for Bug in GDB Simulator for h8300h targets
  2003-12-09 11:51 Patch for Bug in GDB Simulator for h8300h targets Anil Paranjape
@ 2003-12-10  0:11 ` Michael Snyder
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Snyder @ 2003-12-10  0:11 UTC (permalink / raw)
  To: Anil Paranjape; +Cc: gdb-patches

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
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Patch for Bug in GDB Simulator for h8300h targets
  2003-12-16  5:35 Anil Paranjape
@ 2003-12-16 20:18 ` Michael Snyder
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Snyder @ 2003-12-16 20:18 UTC (permalink / raw)
  To: Anil Paranjape; +Cc: gdb-patches

Anil Paranjape wrote:
> Hi Michael,
> 
> I don't have check-in rights. My colleague has Write-After approval check-in rights.
> Is it ok if I request him to check-in the patch ?

No prob, I'll do it.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Patch for Bug in GDB Simulator for h8300h targets
@ 2003-12-16  5:35 Anil Paranjape
  2003-12-16 20:18 ` Michael Snyder
  0 siblings, 1 reply; 6+ messages in thread
From: Anil Paranjape @ 2003-12-16  5:35 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches

Hi Michael,

I don't have check-in rights. My colleague has Write-After approval check-in rights.
Is it ok if I request him to check-in the patch ?

Regards,
Anil Paranjpe

-----Original Message-----
From: Michael Snyder [mailto:msnyder@redhat.com]
Sent: Thursday, December 11, 2003 8:15 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 Michael,
> 
> The maximum memory that can be addressed by H8300H series controllers( H8/3048,H8/3069 etc.)
> is 16 Mbytes i.e. from 0x000000 to 0xFFFFFF. So when H8300H target is selected in simulator, it should be able to address 16 Mbytes of memory(24 bit addressing) but simulator allocates only 
> 256 Kbytes of memory(18 bit addressing). 
> 
> Please refer to section 1.3 of H8300H series programming manual,
> http://www.eu.renesas.com/documents/mpumcu/pdf/h8300h_p.pdf

Anil, thank you for the clarification.  There doesn't appear to be
a maintainer for the H8 simulator, so I'll put on my global maintainer
hat and say "check it in, please".



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Patch for Bug in GDB Simulator for h8300h targets
  2003-12-10  8:29 Anil Paranjape
@ 2003-12-11  2:45 ` Michael Snyder
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Snyder @ 2003-12-11  2:45 UTC (permalink / raw)
  To: Anil Paranjape; +Cc: gdb-patches

Anil Paranjape wrote:
> Hi Michael,
> 
> The maximum memory that can be addressed by H8300H series controllers( H8/3048,H8/3069 etc.)
> is 16 Mbytes i.e. from 0x000000 to 0xFFFFFF. So when H8300H target is selected in simulator, it should be able to address 16 Mbytes of memory(24 bit addressing) but simulator allocates only 
> 256 Kbytes of memory(18 bit addressing). 
> 
> Please refer to section 1.3 of H8300H series programming manual,
> http://www.eu.renesas.com/documents/mpumcu/pdf/h8300h_p.pdf

Anil, thank you for the clarification.  There doesn't appear to be
a maintainer for the H8 simulator, so I'll put on my global maintainer
hat and say "check it in, please".



^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Patch for Bug in GDB Simulator for h8300h targets
@ 2003-12-10  8:29 Anil Paranjape
  2003-12-11  2:45 ` Michael Snyder
  0 siblings, 1 reply; 6+ messages in thread
From: Anil Paranjape @ 2003-12-10  8:29 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches

Hi Michael,

The maximum memory that can be addressed by H8300H series controllers( H8/3048,H8/3069 etc.)
is 16 Mbytes i.e. from 0x000000 to 0xFFFFFF. So when H8300H target is selected in simulator, it should be able to address 16 Mbytes of memory(24 bit addressing) but simulator allocates only 
256 Kbytes of memory(18 bit addressing). 

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,
> 
> 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
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-12-16 20:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-09 11:51 Patch for Bug in GDB Simulator for h8300h targets Anil Paranjape
2003-12-10  0:11 ` Michael Snyder
2003-12-10  8:29 Anil Paranjape
2003-12-11  2:45 ` Michael Snyder
2003-12-16  5:35 Anil Paranjape
2003-12-16 20:18 ` Michael Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox