]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: info: convert verbose field to a bool
authorMike Frysinger <vapier@gentoo.org>
Thu, 19 Jan 2023 01:14:54 +0000 (20:14 -0500)
committerMike Frysinger <vapier@gentoo.org>
Thu, 19 Jan 2023 01:47:55 +0000 (20:47 -0500)
The verbose argument has always been an int treated as a bool, so
convert it to an explicit bool.  Further, update the API docs to
match the reality that the verbose value is actually used by some
of the internal modules.

21 files changed:
include/sim/sim.h
sim/common/cgen-scache.c
sim/common/cgen-scache.h
sim/common/sim-info.c
sim/common/sim-module.c
sim/common/sim-module.h
sim/common/sim-profile.c
sim/common/sim-profile.h
sim/d10v/interp.c
sim/erc32/interf.c
sim/frv/profile.c
sim/h8300/compile.c
sim/m32c/gdb-if.c
sim/m32r/sim-if.c
sim/m68hc11/interp.c
sim/mcore/interp.c
sim/microblaze/interp.c
sim/ppc/sim_calls.c
sim/rl78/gdb-if.c
sim/rx/gdb-if.c
sim/sh/interp.c

index 8f33b094297de21147005e6b2b87ae8d66271d5e..4575269fe7d0ab773ca519bea27e21148138733f 100644 (file)
@@ -20,6 +20,7 @@
 #ifndef SIM_SIM_H
 #define SIM_SIM_H 1
 
+#include <stdbool.h>
 #include <stdint.h>
 
 #ifdef __cplusplus
@@ -197,9 +198,9 @@ int sim_store_register (SIM_DESC sd, int regno, const void *buf, int length);
 
 /* Print whatever statistics the simulator has collected.
 
-   VERBOSE is currently unused and must always be zero.  */
+   When VERBOSE is enabled, extra details will be shown.  */
 
-void sim_info (SIM_DESC sd, int verbose);
+void sim_info (SIM_DESC sd, bool verbose);
 
 
 /* Return a memory map in XML format.
index f087dc72a3e5e66cfdba6997609e8ab22fba688b..c6de30e165754e3e7c2ded5f2d76840402ecc329 100644 (file)
@@ -420,7 +420,7 @@ scache_lookup_or_alloc (SIM_CPU *cpu, IADDR pc, int n, SCACHE **bufp)
 /* Print cache access statics for CPU.  */
 
 void
-scache_print_profile (SIM_CPU *cpu, int verbose)
+scache_print_profile (SIM_CPU *cpu, bool verbose)
 {
   SIM_DESC sd = CPU_STATE (cpu);
   unsigned long hits = CPU_SCACHE_HITS (cpu);
index f3674cc3a0b3b3145f00e6da5664a281908d2f6d..2b79cb1d859c88bed1461fd4b7a6bb1ee60a4924 100644 (file)
@@ -117,7 +117,7 @@ extern void scache_flush_cpu (SIM_CPU *);
 /* Scache profiling support.  */
 
 /* Print summary scache usage information.  */
-extern void scache_print_profile (SIM_CPU *cpu, int verbose);
+extern void scache_print_profile (SIM_CPU *cpu, bool verbose);
 
 #if WITH_PROFILE_SCACHE_P
 
index 0e3554da0d98c9de841253486765aeb938e13980..db8cc85b3580dc489031518cf0dcbdcaf49818ab 100644 (file)
@@ -27,7 +27,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
    sim-module. */
 
 void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
 {
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
   sim_module_info (sd, verbose || STATE_VERBOSE_P (sd));
index 0d5f6c1626394c3f2ec66e8103d12dccae74f73b..f03e4b774b756139bfca3ceb1fbf72fa28f4d797 100644 (file)
@@ -272,7 +272,7 @@ sim_module_uninstall (SIM_DESC sd)
 /* Called when ever simulator info is needed */
 
 void
-sim_module_info (SIM_DESC sd, int verbose)
+sim_module_info (SIM_DESC sd, bool verbose)
 {
   struct module_list *modules = STATE_MODULES (sd);
   MODULE_INFO_LIST *modp;
index d50e5df477d7417c0c8f77e8bbac5c5b9beff50c..cfa06cb37ab3322842028f5e79e9ab3e54eb91f5 100644 (file)
@@ -39,7 +39,7 @@ typedef SIM_RC (MODULE_INIT_FN) (SIM_DESC);
 typedef SIM_RC (MODULE_RESUME_FN) (SIM_DESC);
 typedef SIM_RC (MODULE_SUSPEND_FN) (SIM_DESC);
 typedef void   (MODULE_UNINSTALL_FN) (SIM_DESC);
-typedef void   (MODULE_INFO_FN) (SIM_DESC, int);
+typedef void   (MODULE_INFO_FN) (SIM_DESC, bool);
 
 
 /* Lists of installed handlers.  */
@@ -98,7 +98,7 @@ SIM_RC sim_module_suspend (SIM_DESC sd);
 SIM_RC sim_module_resume (SIM_DESC sd);
 
 /* Report general information on module */
-void sim_module_info (SIM_DESC sd, int verbose);
+void sim_module_info (SIM_DESC sd, bool verbose);
 
 
 /* Module private data */
index 77b2bd3024ee301bd0ac4d58216712df091ef728..6b3853e9e188031d908c3abe5e91068facfc0841 100644 (file)
@@ -611,7 +611,7 @@ profile_pc_init (SIM_DESC sd)
 }
 
 static void
-profile_print_pc (sim_cpu *cpu, int verbose)
+profile_print_pc (sim_cpu *cpu, bool verbose)
 {
   SIM_DESC sd = CPU_STATE (cpu);
   PROFILE_DATA *profile = CPU_PROFILE_DATA (cpu);
@@ -758,7 +758,7 @@ profile_insn_init (SIM_DESC sd)
 }
 
 static void
-profile_print_insn (sim_cpu *cpu, int verbose)
+profile_print_insn (sim_cpu *cpu, bool verbose)
 {
   unsigned int i, n, total, max_val, max_name_len;
   SIM_DESC sd = CPU_STATE (cpu);
@@ -831,7 +831,7 @@ profile_print_insn (sim_cpu *cpu, int verbose)
 #if WITH_PROFILE_MEMORY_P
 
 static void
-profile_print_memory (sim_cpu *cpu, int verbose)
+profile_print_memory (sim_cpu *cpu, bool verbose)
 {
   unsigned int i, n;
   unsigned int total_read, total_write;
@@ -905,7 +905,7 @@ profile_print_memory (sim_cpu *cpu, int verbose)
 #if WITH_PROFILE_CORE_P
 
 static void
-profile_print_core (sim_cpu *cpu, int verbose)
+profile_print_core (sim_cpu *cpu, bool verbose)
 {
   unsigned int total;
   unsigned int max_val;
@@ -962,7 +962,7 @@ profile_print_core (sim_cpu *cpu, int verbose)
 #if WITH_PROFILE_MODEL_P
 
 static void
-profile_print_model (sim_cpu *cpu, int verbose)
+profile_print_model (sim_cpu *cpu, bool verbose)
 {
   SIM_DESC sd = CPU_STATE (cpu);
   PROFILE_DATA *data = CPU_PROFILE_DATA (cpu);
@@ -1110,7 +1110,7 @@ profile_print_addr_ranges (sim_cpu *cpu)
    section titles.  */
 
 static void
-profile_info (SIM_DESC sd, int verbose)
+profile_info (SIM_DESC sd, bool verbose)
 {
   int i,c;
   int print_title_p = 0;
index 23b21ea09d740437a50565dc1984a3ebf4e146ea..9b062f3301b364df2dfd5d080f653914d3eba62f 100644 (file)
@@ -120,7 +120,7 @@ SIM_RC sim_profile_set_option (SIM_DESC sd_, const char *name_, int idx_,
 
 typedef void (PROFILE_INFO_CALLBACK_FN) (SIM_DESC, int);
 struct _sim_cpu; /* forward reference */
-typedef void (PROFILE_INFO_CPU_CALLBACK_FN) (struct _sim_cpu *cpu, int verbose);
+typedef void (PROFILE_INFO_CPU_CALLBACK_FN) (struct _sim_cpu *cpu, bool verbose);
 
 \f
 /* Struct containing most profiling data.
index aebd98ab6ac637c700f74aa7ccbe15b29befad18..46d7bf274ccaa414cf0a20ed7480242e6e8fc0fe 100644 (file)
@@ -1043,7 +1043,7 @@ sim_engine_run (SIM_DESC sd,
 }
 
 void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
 {
   char buf1[40];
   char buf2[40];
index 8af3434f2e757b6bb22f5834242b25f31d06988f..b487c7ca2309bdf4df69f52b676c3cd7a83dacf0 100644 (file)
@@ -354,7 +354,7 @@ sim_read (SIM_DESC sd, uint64_t mem, void *buffer, uint64_t length)
 }
 
 void
-sim_info(SIM_DESC sd, int verbose)
+sim_info(SIM_DESC sd, bool verbose)
 {
     show_stat(&sregs);
 }
index fab941a3e4298e7f739267b50e6d9cd3d5ab8b34..238816b836eb226d4416948ec3a9132020186c3e 100644 (file)
@@ -1991,7 +1991,7 @@ slot_names[] =
 };
 
 static void
-print_parallel (SIM_CPU *cpu, int verbose)
+print_parallel (SIM_CPU *cpu, bool verbose)
 {
   SIM_DESC sd = CPU_STATE (cpu);
   PROFILE_DATA *p = CPU_PROFILE_DATA (cpu);
@@ -2057,7 +2057,7 @@ print_parallel (SIM_CPU *cpu, int verbose)
 }
 
 void
-frv_profile_info (SIM_CPU *cpu, int verbose)
+frv_profile_info (SIM_CPU *cpu, bool verbose)
 {
   /* FIXME: Need to add smp support.  */
   PROFILE_DATA *p = CPU_PROFILE_DATA (cpu);
index 1e303a92eca1095b0e9a00d8e88b45d4387b7b02..a4b39ae3380cf5cb4dbdd100232e133fb5c42de8 100644 (file)
@@ -4489,7 +4489,7 @@ h8300_reg_fetch (SIM_CPU *cpu, int rn, void *buf, int length)
 }
 
 void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
 {
   sim_cpu *cpu = STATE_CPU (sd, 0);
   const struct h8300_sim_state *state = H8300_SIM_STATE (sd);
index 5d4d86f2404a06e405d7fb8447b22c4c4dc43056..410d47cffa814113ef454c1c124da25ffe45cdcc 100644 (file)
@@ -705,7 +705,7 @@ sim_memory_map (SIM_DESC sd)
 }
 
 void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
 {
   printf ("The m32c minisim doesn't collect any statistics.\n");
 }
index de8d870e85c28e08de216bb9d59a0fe4cab15142..d621e3f6dc5b131472397d51863cff1939c44171 100644 (file)
@@ -36,7 +36,7 @@
 #define M32R_DEFAULT_MEM_SIZE 0x2000000 /* 32M */
 
 static void free_state (SIM_DESC);
-static void print_m32r_misc_cpu (SIM_CPU *cpu, int verbose);
+static void print_m32r_misc_cpu (SIM_CPU *cpu, bool verbose);
 \f
 /* Cover function of sim_state_free to free the cpu buffers as well.  */
 
@@ -194,7 +194,7 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char * const *argv,
 /* PROFILE_CPU_CALLBACK */
 
 static void
-print_m32r_misc_cpu (SIM_CPU *cpu, int verbose)
+print_m32r_misc_cpu (SIM_CPU *cpu, bool verbose)
 {
   SIM_DESC sd = CPU_STATE (cpu);
   char buf[20];
index 323ae21448f6f6042f8c1317fd196d73fff6f071..df6bd7bea565f5d2f67cc06bc2b3bbe60594a029 100644 (file)
@@ -515,7 +515,7 @@ sim_engine_run (SIM_DESC sd,
 }
 
 void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
 {
   const char *cpu_type;
   const struct bfd_arch_info *arch;
index f2707fb93743b5771b21b715947cdc5dd1d551d0..53cfdad050b4d3b4cbb6e938f160a85a50074bb8 100644 (file)
@@ -1294,7 +1294,7 @@ mcore_reg_fetch (SIM_CPU *cpu, int rn, void *memory, int length)
 }
 
 void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
 {
   SIM_CPU *cpu = STATE_CPU (sd, 0);
   struct mcore_sim_cpu *mcore_cpu = MCORE_SIM_CPU (cpu);
index f53c1d7d65bc44a4f6ca79d6f1ac1c9d989d2009..5e701e56d40c5d5a1ddab0c155dfe2a7ca0ebf16 100644 (file)
@@ -368,7 +368,7 @@ microblaze_reg_fetch (SIM_CPU *cpu, int rn, void *memory, int length)
 }
 
 void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
 {
   SIM_CPU *cpu = STATE_CPU (sd, 0);
   host_callback *callback = STATE_CALLBACK (sd);
index 88544457c6e5af2e7772443eb967205f3e45ff3b..13e39a6e07b53f30fcad747705f569f39793edc1 100644 (file)
@@ -149,7 +149,7 @@ sim_write (SIM_DESC sd, uint64_t mem, const void *buf, uint64_t length)
 }
 
 void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
 {
   TRACE(trace_gdb, ("sim_info(verbose=%d) called\n", verbose));
   psim_print_info (simulator, verbose);
index be93f578a89767851479157d9ad766f2e9be102c..d780bc0fed056170ab964451174979a0c7b82042 100644 (file)
@@ -391,7 +391,7 @@ sim_store_register (SIM_DESC sd, int regno, const void *buf, int length)
 /* Print out message associated with "info target".  */
 
 void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
 {
   check_desc (sd);
 
index 5e2ad2f02afed8004b8f79cbcdbfd639d5cbee03..a2b9218d89b184ac15ec384254868021140cd994 100644 (file)
@@ -644,7 +644,7 @@ sim_store_register (SIM_DESC sd, int regno, const void *buf, int length)
 }
 
 void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
 {
   check_desc (sd);
 
index c067f0f2bea6935c26b644f1c8d6b9e943226bbf..2e2e13641e43cdd76bc39e34fad9b5aa60b6b8ed 100644 (file)
@@ -2272,7 +2272,7 @@ sim_stop_reason (SIM_DESC sd, enum sim_stop *reason, int *sigrc)
 }
 
 void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
 {
   double timetaken = 
     (double) saved_state.asregs.ticks / (double) now_persec ();