From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16521 invoked by alias); 15 May 2002 13:02:10 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 16484 invoked from network); 15 May 2002 13:02:07 -0000 Received: from unknown (HELO harvester.transas.com) (193.125.200.2) by sources.redhat.com with SMTP; 15 May 2002 13:02:07 -0000 Received: from localhost (localhost [127.0.0.1]) by harvester.transas.com (Postfix) with SMTP id 4BD6B6B827 for ; Wed, 15 May 2002 17:02:06 +0400 (MSD) Received: from clue.transas.com (clue.transas.com [10.0.0.42]) by harvester.transas.com (Postfix) with ESMTP id D5A516B823 for ; Wed, 15 May 2002 17:02:05 +0400 (MSD) Received: by clue.transas.com with Internet Mail Service (5.5.2653.19) id ; Wed, 15 May 2002 17:02:05 +0400 Message-ID: <2E74F312D6980D459F3A05492BA40F8DDA4246@clue.transas.com> From: Andrew Volkov To: gdb-patches@sources.redhat.com Subject: RE: [patch/rfc] h8300 Change literal reg numbers to REGNUM macros Date: Wed, 15 May 2002 06:02:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" X-SW-Source: 2002-05/txt/msg00597.txt.bz2 Corrected Andrey > > > -----Original Message----- > > From: Richard Earnshaw [mailto:rearnsha@arm.com] > > Sent: Wednesday, May 15, 2002 4:04 PM > > To: Andrew Volkov > > Cc: gdb-patches@sources.redhat.com; Richard.Earnshaw@arm.com > > Subject: [patch/rfc] h8300 Change literal reg numbers to > REGNUM macros > > > > > > ! return time (0); //WinXX HAS UNIX like 'time', so why > > not using it? > > C++ style comments are not legal ANSI C. > > > > R. > > > > > 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 *** h8300-tdep.c 16 Mar 2001 22:34:45 -0000 1.7 --- 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 --- h8300/compile.c 20 Dec 2001 17:36:23 -0000 1.8 +++ 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;