This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Patch for Bug in GDB Simulator for h8300h targets
- From: "Anil Paranjape" <AnilP1 at KPITCummins dot com>
- To: <gdb-patches at sources dot redhat dot com>
- Date: Tue, 9 Dec 2003 17:20:04 +0530
- Subject: Patch for Bug in GDB Simulator for h8300h targets
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