diff options
author | Kazu Hirata <kazu@codesourcery.com> | 2003-02-05 23:10:27 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@codesourcery.com> | 2003-02-05 23:10:27 +0000 |
commit | ec38ce9947b8f46296c1cc1704f5f7f672ed93bd (patch) | |
tree | 41ecdb4772c833772f5593b36664b77f0eff9b80 | |
parent | 5b729aa5d62dcd4b4ab9fa65c3073804172974f0 (diff) | |
download | gdb-ec38ce9947b8f46296c1cc1704f5f7f672ed93bd.zip gdb-ec38ce9947b8f46296c1cc1704f5f7f672ed93bd.tar.gz gdb-ec38ce9947b8f46296c1cc1704f5f7f672ed93bd.tar.bz2 |
* compile.c (init_pointers): Abort if wreg never gets initialized.
(sim_resume): Fix the handling of exts.w and extu.w.
-rw-r--r-- | sim/h8300/ChangeLog | 5 | ||||
-rw-r--r-- | sim/h8300/compile.c | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog index 62fd073..2753416 100644 --- a/sim/h8300/ChangeLog +++ b/sim/h8300/ChangeLog @@ -1,3 +1,8 @@ +2003-02-05 Kazu Hirata <kazu@cs.umass.edu> + + * compile.c (init_pointers): Abort if wreg never gets initialized. + (sim_resume): Fix the handling of exts.w and extu.w. + 2003-01-31 Kazu Hirata <kazu@cs.umass.edu> * compile.c (sim_resume): Fix the handling of bxor. diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c index e845899..2a066a3 100644 --- a/sim/h8300/compile.c +++ b/sim/h8300/compile.c @@ -753,6 +753,7 @@ init_pointers (void) } p++; } + wreg[i] = wreg[i + 8] = 0; while (q < u) { if (*q == 0x2233) @@ -765,6 +766,8 @@ init_pointers (void) } q++; } + if (wreg[i] == 0 || wreg[i + 8] == 0) + abort (); cpu.regs[i] = 0; lreg[i] = &cpu.regs[i]; } @@ -1606,7 +1609,7 @@ sim_resume (SIM_DESC sd, int step, int siggnal) goto next; } case O (O_EXTS, SW): - rd = GET_B_REG (code->src.reg + 8) & 0xff; /* Yes, src, not dst. */ + rd = GET_W_REG (code->src.reg) & 0xff; /* Yes, src, not dst. */ ea = rd & 0x80 ? -256 : 0; res = rd + ea; goto log16; @@ -1616,7 +1619,7 @@ sim_resume (SIM_DESC sd, int step, int siggnal) res = rd + ea; goto log32; case O (O_EXTU, SW): - rd = GET_B_REG (code->src.reg + 8) & 0xff; + rd = GET_W_REG (code->src.reg) & 0xff; ea = 0; res = rd + ea; goto log16; |