public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Jiri Gaisler <jiri@gaisler.se>
To: gdb-patches@sourceware.org
Cc: Jiri Gaisler <jiri@gaisler.se>
Subject: [PATCH v4 01/13] sim/erc32: Added -v command line switch for verbose output
Date: Tue, 17 Mar 2015 21:03:00 -0000	[thread overview]
Message-ID: <1426626170-21401-2-git-send-email-jiri@gaisler.se> (raw)
In-Reply-To: <1426626170-21401-1-git-send-email-jiri@gaisler.se>

	* func.c (show_stat) : Print simulation time in portable long long format.

	* help.c (usage) : update usage help print-out

	* sis.c (run_sim) : increase debug level with -v. Also print
	simulation time in portable long long format.

	* sis.h : Use stdint.h for portable 32- and 64-bit ints.
---
 sim/erc32/func.c |  5 +++--
 sim/erc32/help.c |  2 +-
 sim/erc32/sis.c  |  9 ++++++---
 sim/erc32/sis.h  | 10 ++++------
 4 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/sim/erc32/func.c b/sim/erc32/func.c
index 69d5eba..260ceff 100644
--- a/sim/erc32/func.c
+++ b/sim/erc32/func.c
@@ -28,6 +28,7 @@
 #include "sis.h"
 #include <dis-asm.h>
 #include "sim-config.h"
+#include <inttypes.h>
 
 
 #define	VAL(x)	strtoul(x,(char **)NULL,0)
@@ -642,8 +643,8 @@ show_stat(sregs)
 	sregs->nbranch;
 #endif
 
-    printf("\n Cycles       : %9d\n\r", ebase.simtime - sregs->simstart);
-    printf(" Instructions : %9d\n", sregs->ninst);
+    printf("\n Cycles       : %9" PRIu64 "\n\r", ebase.simtime - sregs->simstart);
+    printf(" Instructions : %9" PRIu64 "\n", sregs->ninst);
 
 #ifdef STAT
     printf("   integer    : %9.2f %%\n", 100.0 * (float) iinst / (float) sregs->ninst);
diff --git a/sim/erc32/help.c b/sim/erc32/help.c
index 21c2a77..9813bda 100644
--- a/sim/erc32/help.c
+++ b/sim/erc32/help.c
@@ -7,8 +7,8 @@ usage()
 {
 
     printf("usage: sis [-uart1 uart_device1] [-uart2 uart_device2]\n");
+    printf("[-sparclite] [-dumbio] [-v] \n");
     printf("[-nfp] [-freq frequency] [-c batch_file] [files]\n");
-    printf("[-sparclite] [-dumbio]\n");
 }
 
 void
diff --git a/sim/erc32/sis.c b/sim/erc32/sis.c
index ce9b3d0..931e3f3 100644
--- a/sim/erc32/sis.c
+++ b/sim/erc32/sis.c
@@ -30,6 +30,7 @@
 #include "sis.h"
 #include <dis-asm.h>
 #include "sim-config.h"
+#include <inttypes.h>
 
 #define	VAL(x)	strtol(x,(char **)NULL,0)
 
@@ -113,7 +114,7 @@ run_sim(sregs, icount, dis)
 			        sregs->histind = 0;
 		        }
 		        if (dis) {
-			    printf(" %8u ", ebase.simtime);
+			    printf(" %8" PRIu64 " ", ebase.simtime);
 			    dis_mem(sregs->pc, 1, &dinfo);
 		        }
 		    }
@@ -205,6 +206,8 @@ main(argc, argv)
 #endif
             } else if (strcmp(argv[stat], "-dumbio") == 0) {
 		dumbio = 1;
+            } else if (strcmp(argv[stat], "-v") == 0) {
+		sis_verbose += 1;
 	    } else {
 		printf("unknown option %s\n", argv[stat]);
 		usage();
@@ -271,7 +274,7 @@ main(argc, argv)
 	case CTRL_C:
 	    printf("\b\bInterrupt!\n");
 	case TIME_OUT:
-	    printf(" Stopped at time %d (%.3f ms)\n", ebase.simtime, 
+	    printf(" Stopped at time %" PRIu64 " (%.3f ms)\n", ebase.simtime,
 	      ((double) ebase.simtime / (double) sregs.freq) / 1000.0);
 	    break;
 	case BPT_HIT:
@@ -281,7 +284,7 @@ main(argc, argv)
 	case ERROR:
 	    printf("IU in error mode (%d)\n", sregs.trap);
 	    stat = 0;
-	    printf(" %8d ", ebase.simtime);
+	    printf(" %8" PRIu64 " ", ebase.simtime);
 	    dis_mem(sregs.pc, 1, &dinfo);
 	    break;
 	default:
diff --git a/sim/erc32/sis.h b/sim/erc32/sis.h
index 6820cb4..74466ae 100644
--- a/sim/erc32/sis.h
+++ b/sim/erc32/sis.h
@@ -24,7 +24,8 @@
 #include "gdb/callback.h"
 #include "gdb/remote-sim.h"
 #include <sim-config.h>
- 
+#include <stdint.h>
+
 #if WITH_HOST_BYTE_ORDER == BIG_ENDIAN
 #define HOST_BIG_ENDIAN
 #else
@@ -56,11 +57,8 @@ typedef unsigned int uint32;	/* 32-bit unsigned int */
 typedef float   float32;	/* 32-bit float */
 typedef double  float64;	/* 64-bit float */
 
-/* FIXME: what about host compilers that don't support 64-bit ints? */
-typedef unsigned long long uint64; /* 64-bit unsigned int */
-typedef long long int64;	   /* 64-bit signed int */
-
-#define UINT64_MAX 18446744073709551615ULL
+typedef uint64_t uint64; /* 64-bit unsigned int */
+typedef int64_t int64;	   /* 64-bit signed int */
 
 struct pstate {
 
-- 
1.9.1

  parent reply	other threads:[~2015-03-17 21:03 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17 21:03 [PATCH v4 00/13] Update of the SPARC SIS simulator Jiri Gaisler
2015-03-17 21:03 ` [PATCH v4 09/13] sim/erc32: Add support for LEON3 processor emulation Jiri Gaisler
2015-03-17 21:03 ` [PATCH v4 04/13] sim/erc32: Use memory_iread() function for instruction fetching Jiri Gaisler
2015-03-28  7:01   ` Mike Frysinger
2015-03-17 21:03 ` [PATCH v4 06/13] sim/erc32: Use gdb callback for UART I/O when linked with gdb Jiri Gaisler
2015-03-28  7:13   ` Mike Frysinger
2015-03-17 21:03 ` Jiri Gaisler [this message]
2015-03-17 22:56   ` [PATCH v4 01/13] sim/erc32: Added -v command line switch for verbose output Mike Frysinger
2015-03-17 21:03 ` [PATCH v4 05/13] sim/erc32: Fix a few compiler warnings Jiri Gaisler
2015-03-28  7:06   ` Mike Frysinger
2015-03-17 21:03 ` [PATCH v4 03/13] sim/erc32: Switched emulated memory to host endian order Jiri Gaisler
2015-03-22 22:46   ` Mike Frysinger
2015-03-23  9:01     ` Jiri Gaisler
2015-03-28  7:41       ` Mike Frysinger
2015-03-28  8:21         ` Jiri Gaisler
2015-03-24  9:39     ` Jiri Gaisler
2015-03-27 10:26     ` Jiri Gaisler
2015-03-17 21:03 ` [PATCH v4 02/13] sim/erc32: Removed type mismatch compiler warnings Jiri Gaisler
2015-03-17 22:59   ` Mike Frysinger
2015-03-17 21:03 ` [PATCH v4 10/13] sim/erc32: Add support for LEON2 processor emulation Jiri Gaisler
2015-03-28  7:21   ` Mike Frysinger
2015-03-17 21:03 ` [PATCH v4 11/13] sim/erc32: Updated documentation Jiri Gaisler
2015-03-28  7:17   ` Mike Frysinger
2015-03-17 21:03 ` [PATCH v4 12/13] sim/erc32: Add data watchpoint support Jiri Gaisler
2015-03-28  7:16   ` Mike Frysinger
2015-03-17 21:03 ` [PATCH v4 07/13] sim/erc32: Access memory subsystem through struct memsys Jiri Gaisler
2015-03-28  7:15   ` Mike Frysinger
2015-03-17 21:04 ` [PATCH v4 08/13] sim/erc32: Move local extern declarations into sis.h Jiri Gaisler
2015-03-17 21:04 ` [PATCH v4 13/13] Add watchpoint support to gdb simulator interface Jiri Gaisler
2015-03-28  7:19   ` Mike Frysinger
2015-03-30 20:51     ` Jiri Gaisler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1426626170-21401-2-git-send-email-jiri@gaisler.se \
    --to=jiri@gaisler.se \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).