contrib/gdb-7/gdb/utils.c
static void
report_command_stats (void *arg)
{
  struct cmd_stats *start_stats = (struct cmd_stats *) arg;
  int msg_type = start_stats->msg_type;

  if (display_time)
    {
      long cmd_time = get_run_time () - start_stats->start_cpu_time;
      struct timeval now_wall_time, delta_wall_time;

      gettimeofday (&now_wall_time, NULL);
      timeval_sub (&delta_wall_time,
		   &now_wall_time, &start_stats->start_wall_time);

      printf_unfiltered (msg_type == 0
			 ? _("Startup time: %ld.%06ld (cpu), %ld.%06ld (wall)\n")
			 : _("Command execution time: %ld.%06ld (cpu), %ld.%06ld (wall)\n"),
			 cmd_time / 1000000, cmd_time % 1000000,
			 (long) delta_wall_time.tv_sec,
			 (long) delta_wall_time.tv_usec);
    }

  if (display_space)
    {
#ifdef HAVE_SBRK
      char *lim = (char *) sbrk (0);

      long space_now = lim - lim_at_start;
      long space_diff = space_now - start_stats->start_space;

      printf_unfiltered (msg_type == 0
			 ? _("Space used: %ld (%s%ld during startup)\n")
			 : _("Space used: %ld (%s%ld for this command)\n"),
			 space_now,
			 (space_diff >= 0 ? "+" : ""),
			 space_diff);
#endif
    }
}
/* As indicated by display_time and display_space, report GDB's elapsed time
   and space usage from the base time and space provided in ARG, which
   must be a pointer to a struct cmd_stat.  This function is intended
   to be called as a cleanup.  */
As indicated by display_time and display_space, report GDB's elapsed time
and space usage from the base time and space provided in ARG, which
must be a pointer to a struct cmd_stat.  This function is intended
to be called as a cleanup.
As indicated by display_time and display_space report GDB ' s elapsed time and space usage from the base time and space provided in ARG which must be a pointer to a struct cmd_stat . This function is intended to be called as a cleanup .
static void
report_command_stats (void *arg)
{
  struct cmd_stats *start_stats = (struct cmd_stats *) arg;
  int msg_type = start_stats->msg_type;
  if (display_time)
    {
      long cmd_time = get_run_time () - start_stats->start_cpu_time;
      struct timeval now_wall_time, delta_wall_time;
      gettimeofday (&now_wall_time, NULL);
      timeval_sub (&delta_wall_time,
		   &now_wall_time, &start_stats->start_wall_time);
      printf_unfiltered (msg_type == 0
			 ? _("Startup time: %ld.%06ld (cpu), %ld.%06ld (wall)\n")
			 : _("Command execution time: %ld.%06ld (cpu), %ld.%06ld (wall)\n"),
			 cmd_time / 1000000, cmd_time % 1000000,
			 (long) delta_wall_time.tv_sec,
			 (long) delta_wall_time.tv_usec);
    }
  if (display_space)
    {
#ifdef HAVE_SBRK
      char *lim = (char *) sbrk (0);
      long space_now = lim - lim_at_start;
      long space_diff = space_now - start_stats->start_space;
      printf_unfiltered (msg_type == 0
			 ? _("Space used: %ld (%s%ld during startup)\n")
			 : _("Space used: %ld (%s%ld for this command)\n"),
			 space_now,
			 (space_diff >= 0 ? "+" : ""),
			 space_diff);
#endif
    }
}
static void report_command_stats ( void * arg ) { struct cmd_stats * start_stats = ( struct cmd_stats * ) arg ; int msg_type = start_stats -> msg_type ; if ( display_time ) { long cmd_time = get_run_time ( ) - start_stats -> start_cpu_time ; struct timeval now_wall_time , delta_wall_time ; gettimeofday ( & now_wall_time , NULL ) ; timeval_sub ( & delta_wall_time , & now_wall_time , & start_stats -> start_wall_time ) ; printf_unfiltered ( msg_type == 0 ? _ ( " \n " ) : _ ( " \n " ) , cmd_time / 1000000 , cmd_time % 1000000 , ( long ) delta_wall_time . tv_sec , ( long ) delta_wall_time . tv_usec ) ; } if ( display_space ) { #ifdef HAVE_SBRK char * lim = ( char * ) sbrk ( 0 ) ; long space_now = lim - lim_at_start ; long space_diff = space_now - start_stats -> start_space ; printf_unfiltered ( msg_type == 0 ? _ ( " \n " ) : _ ( " \n " ) , space_now , ( space_diff >= 0 ? " " : " " ) , space_diff ) ; #endif } }
As indicated by display_time and display_space, report GDB's elapsed time
and space usage from the base time and space provided in ARG, which
must be a pointer to a struct cmd_stat.
As indicated by display_time and display_space report GDB ' s elapsed time and space usage from the base time and space provided in ARG which must be a pointer to a struct cmd_stat .