Re: [hatari-devel] Solved: Pure debugger, illegal opcodes, exceptions

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Am Wed, 10 Oct 2012 19:16:09 +0300
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:

> Hi,
> 
> On keskiviikko 10 lokakuu 2012, Uwe Seimet wrote:
> > I found what's wrong: It's the way the debug message is generated.
> > This is from newcpu.c line 2529:
> > 
> >        if (warned < 20) {
> >                 write_log ("Illegal instruction: %04x at %08X ->
> > %08X\n", opcode, pc, get_long (regs.vbr + 0x10));
> > 
> > get_long() results in a bus error, i.e. write_log causes the actual
> > crash by calling get_long(). After removing this line PD starts
> > without any crash.

Great, very well spotted, Uwe!

> What you pointed out isn't even the only debug statement with this
> issue: $ grep write_log src/cpu/*.c|grep get_
> src/cpu/newcpu.c:            write_log ("Exception %d (%x) at %x ->
> %x!\n", nr, oldpc, currpc, get_long (4 * nr));
> src/cpu/newcpu.c:            write_log ("Exception %d (%x) at %x ->
> %x!\n", nr, oldpc, currpc, get_long (regs.vbr + 4*nr));
> src/cpu/newcpu.c:                    write_log ("Exception %d (%x) at
> %x -> %x!\n", nr, oldpc, currpc, x_get_long (regs.vbr + 4*nr));
> src/cpu/newcpu.c:            write_log ("Exception %d (%x) at %x ->
> %x!\n", nr, oldpc, currpc, x_get_long (regs.vbr + 4*nr));
> src/cpu/newcpu.c:            write_log ("Illegal instruction: %04x at
> %08X -
> > %08X\n", opcode, pc, get_long (regs.vbr + 0x10));
> src/cpu/newcpu.c:    //write_log ("ACTUAL=%d ERROR=%d\n", get_long
> (request 
> + 32), get_byte (request + 31));

I think most of the other statements you listed here should be fine,
since the Exception handler switches to supervisor mode before calling
these write_log functions.

 Thomas



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/