This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

nrun-1.patch


I haven't seen any follow up to my last message on the subject
(which I believe was convincing), therefore I'm submitting this patch.

Appended is my last message to refresh your memory.  :-)

2000-10-04  Doug Evans  <dje@casey.transmeta.com>

	* common/nrun.c (main): Back out change of Jul 27.  Always call sim_info.
	* m68hc11/interp.c (sim_info): Only print something if
	STATE_VERBOSE_P.

Index: common/nrun.c
===================================================================
RCS file: /cvs/src/src/sim/common/nrun.c,v
retrieving revision 1.2
diff -c -p -r1.2 nrun.c
*** nrun.c	2000/07/27 11:49:07	1.2
--- nrun.c	2000/10/04 07:28:44
*************** main (int argc, char **argv)
*** 164,172 ****
  		 (STATE_ENVIRONMENT (sd) == OPERATING_ENVIRONMENT));
        
      }
    /* Print any stats the simulator collected.  */
!   if (STATE_VERBOSE_P (sd))
!     sim_info (sd, 0);
    
    /* Shutdown the simulator.  */
    sim_close (sd, 0);
--- 164,172 ----
  		 (STATE_ENVIRONMENT (sd) == OPERATING_ENVIRONMENT));
        
      }
+ 
    /* Print any stats the simulator collected.  */
!   sim_info (sd, 0);
    
    /* Shutdown the simulator.  */
    sim_close (sd, 0);
Index: m68hc11/interp.c
===================================================================
RCS file: /cvs/src/src/sim/m68hc11/interp.c,v
retrieving revision 1.3
diff -c -p -r1.3 interp.c
*** interp.c	2000/09/10 14:05:29	1.3
--- interp.c	2000/10/04 07:28:44
*************** sim_trace (SIM_DESC sd)
*** 302,311 ****
  void
  sim_info (SIM_DESC sd, int verbose)
  {
!   sim_io_eprintf (sd, "Simulator info:\n");
!   sim_io_eprintf (sd, "  CPU Motorola 68HC11\n");
!   sim_get_info (sd, 0);
!   sim_module_info (sd, verbose || STATE_VERBOSE_P (sd));
  }
  
  SIM_RC
--- 302,314 ----
  void
  sim_info (SIM_DESC sd, int verbose)
  {
!   if (STATE_VERBOSE_P (sd))
!     {
!       sim_io_eprintf (sd, "Simulator info:\n");
!       sim_io_eprintf (sd, "  CPU Motorola 68HC11\n");
!       sim_get_info (sd, 0);
!       sim_module_info (sd, 1);
!     }
  }
  
  SIM_RC



From: Doug Evans <dje@casey.transmeta.com>
Date: Sun, 10 Sep 2000 17:01:59 -0700 (PDT)
To: Stephane Carrez <Stephane.Carrez@worldnet.fr>
Cc: cagney@redhat.com,
    gdb-patches@sourceware.cygnus.com
Subject: Re: nrun.c patch
In-Reply-To: <39BBFE2C.28B6D825@worldnet.fr>
References: <200009100427.VAA27516@casey.transmeta.com>
	<39BBADC1.94352650@worldnet.fr>
	<14779.49324.843786.880750@casey.transmeta.com>
	<39BBFE2C.28B6D825@worldnet.fr>

Stephane Carrez writes:
 >  - several simulator (h8300, h8500, mcore, d10v, sh, w65) are printing statistics
 >    about insn or cpu cycles executed (and I'm doing the same for 68hc11). 
 >    None of them are checking flags as you suggest.
 > 
 > May be the way things were intended to work are not correct and we can fix that.
 > Now, I just want/need a common way to enable/disable the simulator statistics.

Look at it this way.

The minute a simulator has more than one thing the user may choose
to ask the simulator to print out, sim_info has to test which one the
user asked for (which can be none, any combination of, or all).
It's simpler and cleaner to just always call sim_info,
and let sim_info test for what to print / not print.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]