This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re:[PATCH/RFA] h8300 Multiple changes to gdb/sim-stage1
- From: Andrew Volkov <Andrew dot Volkov at transas dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 16 May 2002 16:15:51 +0400
- Subject: Re:[PATCH/RFA] h8300 Multiple changes to gdb/sim-stage1
Splitting after suggestions of Andrew Cagney.
Andrey Volkov
2002-05-15 Andrey Volkov <avolkov@sources.redhat.com>
* gdb/h8300-tdep.c: Fix literal regnumbers to REGNUMS.
* sim/h8300/compile.c: Ditto.
* sim/h8300/compile.c: Fix instruction and cycles counting
Index: gdb/h8300-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/h8300-tdep.c,v
retrieving revision 1.7
diff -u -u -c -p -r1.7 h8300-tdep.c
*** src/gdb/h8300-tdep.c 16 Mar 2001 22:34:45 -0000 1.7
--- src/gdb/h8300-tdep.c 15 May 2002 12:45:44 -0000
*************** _initialize_h8300m (void)
*** 828,841 ****
void
h8300_print_register_hook (int regno)
{
! if (regno == 8)
{
/* CCR register */
int C, Z, N, V;
! unsigned char b[4];
unsigned char l;
read_relative_register_raw_bytes (regno, b);
! l = b[REGISTER_VIRTUAL_SIZE (8) - 1];
printf_unfiltered ("\t");
printf_unfiltered ("I-%d - ", (l & 0x80) != 0);
printf_unfiltered ("H-%d - ", (l & 0x20) != 0);
--- 828,841 ----
void
h8300_print_register_hook (int regno)
{
! if (regno == CCR_REGNUM)
{
/* CCR register */
int C, Z, N, V;
! unsigned char b[REGISTER_SIZE];
unsigned char l;
read_relative_register_raw_bytes (regno, b);
! l = b[REGISTER_VIRTUAL_SIZE (CCR_REGNUM) - 1];
printf_unfiltered ("\t");
printf_unfiltered ("I-%d - ", (l & 0x80) != 0);
printf_unfiltered ("H-%d - ", (l & 0x20) != 0);
Index: sim/h8300/compile.c
===================================================================
RCS file: /cvs/src/src/sim/h8300/compile.c,v
retrieving revision 1.8
diff -u -r1.8 compile.c
--- src/sim/h8300/compile.c 20 Dec 2001 17:36:23 -0000 1.8
+++ src/sim/h8300/compile.c 15 May 2002 12:41:48 -0000
@@ -111,10 +111,7 @@
static int
get_now ()
{
-#ifndef WIN32
- return time (0);
-#endif
- return 0;
+ return time (0); /* WinXX HAS UNIX like 'time', so why not using it?
*/
}
static int
@@ -155,7 +152,7 @@
return X (OP_MEM, SP);
default:
- abort ();
+ abort (); /* ?? May be something more usefull? */
}
}
@@ -608,7 +605,7 @@
return t;
default:
- abort ();
+ abort (); /* ?? May be something more usefull? */
}
}
@@ -997,8 +994,12 @@
#endif
- cycles += code->cycles;
- insts++;
+ if (code->opcode)
+ {
+ cycles += code->cycles;
+ insts++;
+ }
+
switch (code->opcode)
{
case 0:
@@ -1860,10 +1861,10 @@
{
default:
abort ();
- case 8:
+ case CCR_REGNUM:
v = cpu.ccr;
break;
- case 9:
+ case PC_REGNUM:
v = cpu.pc;
break;
case R0_REGNUM:
@@ -1876,15 +1877,15 @@
case R7_REGNUM:
v = cpu.regs[rn];
break;
- case 10:
+ case CYCLE_REGNUM:
v = cpu.cycles;
longreg = 1;
break;
- case 11:
+ case TICK_REGNUM:
v = cpu.ticks;
longreg = 1;
break;
- case 12:
+ case INST_REGNUM:
v = cpu.insts;
longreg = 1;
break;