From patchwork Tue Feb 17 07:44:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Gaisler X-Patchwork-Id: 5110 Received: (qmail 32680 invoked by alias); 17 Feb 2015 07:45:37 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 32343 invoked by uid 89); 17 Feb 2015 07:45:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: bin-vsp-out-01.atm.binero.net Received: from vsp-unauthed01.binero.net (HELO bin-vsp-out-01.atm.binero.net) (195.74.38.225) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 17 Feb 2015 07:45:31 +0000 X-Halon-ID: fb4ac00e-b678-11e4-acbf-005056917a89 Authorized-sender: jiri@gaisler.se Received: from vaio.orange-hotspot.com (unknown [81.253.22.86]) by bin-vsp-out-01.atm.binero.net (Halon Mail Gateway) with ESMTPSA; Tue, 17 Feb 2015 08:45:45 +0100 (CET) From: Jiri Gaisler To: gdb-patches@sourceware.org Cc: Jiri Gaisler Subject: [PATCH 08/23] sim/erc32: added -v and -vv command line switches for verbose output Date: Tue, 17 Feb 2015 08:44:45 +0100 Message-Id: <1424159099-5148-9-git-send-email-jiri@gaisler.se> In-Reply-To: <1424159099-5148-1-git-send-email-jiri@gaisler.se> References: <1424159099-5148-1-git-send-email-jiri@gaisler.se> * help.c (usage) update usage help print-out * sis.c (run_sim) increase debug level with -v and -vv. Also print simulation time in long long format. --- sim/erc32/help.c | 2 +- sim/erc32/sis.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sim/erc32/help.c b/sim/erc32/help.c index 21c2a77..6d74e79 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] [-vv]\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 39050d7..97f1b31 100644 --- a/sim/erc32/sis.c +++ b/sim/erc32/sis.c @@ -122,7 +122,7 @@ run_sim(sregs, icount, dis) sregs->histind = 0; } if (dis) { - printf(" %8u ", ebase.simtime); + printf(" %8llu ", ebase.simtime); dis_mem(sregs->pc, 1, &dinfo); } } @@ -214,6 +214,10 @@ main(argc, argv) #endif } else if (strcmp(argv[stat], "-dumbio") == 0) { dumbio = 1; + } else if (strcmp(argv[stat], "-v") == 0) { + sis_verbose = 1; + } else if (strcmp(argv[stat], "-vv") == 0) { + sis_verbose = 2; } else { printf("unknown option %s\n", argv[stat]); usage(); @@ -279,7 +283,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 %llu (%.3f ms)\n", ebase.simtime, ((double) ebase.simtime / (double) sregs.freq) / 1000.0); break; case BPT_HIT: @@ -289,7 +293,7 @@ main(argc, argv) case ERROR: printf("IU in error mode (%d)\n", sregs.trap); stat = 0; - printf(" %8d ", ebase.simtime); + printf(" %8llu ", ebase.simtime); dis_mem(sregs.pc, 1, &dinfo); break; default: