aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2023-01-18 20:14:54 -0500
committerMike Frysinger <vapier@gentoo.org>2023-01-18 20:47:55 -0500
commitcc67f780ecdb8a5c50eaae9e04b7fc11ce23ddba (patch)
treec8445fbe78b1e5a2599e45689cf67e14938ceaf7
parent7fd14d6f580eeed46ef4d6f04f6b5f2f1318c0f9 (diff)
downloadfsf-binutils-gdb-cc67f780ecdb8a5c50eaae9e04b7fc11ce23ddba.zip
fsf-binutils-gdb-cc67f780ecdb8a5c50eaae9e04b7fc11ce23ddba.tar.gz
fsf-binutils-gdb-cc67f780ecdb8a5c50eaae9e04b7fc11ce23ddba.tar.bz2
sim: info: convert verbose field to a bool
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.
-rw-r--r--include/sim/sim.h5
-rw-r--r--sim/common/cgen-scache.c2
-rw-r--r--sim/common/cgen-scache.h2
-rw-r--r--sim/common/sim-info.c2
-rw-r--r--sim/common/sim-module.c2
-rw-r--r--sim/common/sim-module.h4
-rw-r--r--sim/common/sim-profile.c12
-rw-r--r--sim/common/sim-profile.h2
-rw-r--r--sim/d10v/interp.c2
-rw-r--r--sim/erc32/interf.c2
-rw-r--r--sim/frv/profile.c4
-rw-r--r--sim/h8300/compile.c2
-rw-r--r--sim/m32c/gdb-if.c2
-rw-r--r--sim/m32r/sim-if.c4
-rw-r--r--sim/m68hc11/interp.c2
-rw-r--r--sim/mcore/interp.c2
-rw-r--r--sim/microblaze/interp.c2
-rw-r--r--sim/ppc/sim_calls.c2
-rw-r--r--sim/rl78/gdb-if.c2
-rw-r--r--sim/rx/gdb-if.c2
-rw-r--r--sim/sh/interp.c2
21 files changed, 31 insertions, 30 deletions
diff --git a/include/sim/sim.h b/include/sim/sim.h
index 8f33b09..4575269 100644
--- a/include/sim/sim.h
+++ b/include/sim/sim.h
@@ -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.
diff --git a/sim/common/cgen-scache.c b/sim/common/cgen-scache.c
index f087dc7..c6de30e 100644
--- a/sim/common/cgen-scache.c
+++ b/sim/common/cgen-scache.c
@@ -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);
diff --git a/sim/common/cgen-scache.h b/sim/common/cgen-scache.h
index f3674cc..2b79cb1 100644
--- a/sim/common/cgen-scache.h
+++ b/sim/common/cgen-scache.h
@@ -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
diff --git a/sim/common/sim-info.c b/sim/common/sim-info.c
index 0e3554d..db8cc85 100644
--- a/sim/common/sim-info.c
+++ b/sim/common/sim-info.c
@@ -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));
diff --git a/sim/common/sim-module.c b/sim/common/sim-module.c
index 0d5f6c1..f03e4b7 100644
--- a/sim/common/sim-module.c
+++ b/sim/common/sim-module.c
@@ -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;
diff --git a/sim/common/sim-module.h b/sim/common/sim-module.h
index d50e5df..cfa06cb 100644
--- a/sim/common/sim-module.h
+++ b/sim/common/sim-module.h
@@ -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 */
diff --git a/sim/common/sim-profile.c b/sim/common/sim-profile.c
index 77b2bd3..6b3853e 100644
--- a/sim/common/sim-profile.c
+++ b/sim/common/sim-profile.c
@@ -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;
diff --git a/sim/common/sim-profile.h b/sim/common/sim-profile.h
index 23b21ea..9b062f3 100644
--- a/sim/common/sim-profile.h
+++ b/sim/common/sim-profile.h
@@ -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);
/* Struct containing most profiling data.
diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c
index aebd98a..46d7bf2 100644
--- a/sim/d10v/interp.c
+++ b/sim/d10v/interp.c
@@ -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];
diff --git a/sim/erc32/interf.c b/sim/erc32/interf.c
index 8af3434..b487c7c 100644
--- a/sim/erc32/interf.c
+++ b/sim/erc32/interf.c
@@ -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);
}
diff --git a/sim/frv/profile.c b/sim/frv/profile.c
index fab941a..238816b 100644
--- a/sim/frv/profile.c
+++ b/sim/frv/profile.c
@@ -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);
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index 1e303a9..a4b39ae 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -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);
diff --git a/sim/m32c/gdb-if.c b/sim/m32c/gdb-if.c
index 5d4d86f..410d47c 100644
--- a/sim/m32c/gdb-if.c
+++ b/sim/m32c/gdb-if.c
@@ -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");
}
diff --git a/sim/m32r/sim-if.c b/sim/m32r/sim-if.c
index de8d870..d621e3f 100644
--- a/sim/m32r/sim-if.c
+++ b/sim/m32r/sim-if.c
@@ -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);
/* 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];
diff --git a/sim/m68hc11/interp.c b/sim/m68hc11/interp.c
index 323ae21..df6bd7b 100644
--- a/sim/m68hc11/interp.c
+++ b/sim/m68hc11/interp.c
@@ -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;
diff --git a/sim/mcore/interp.c b/sim/mcore/interp.c
index f2707fb..53cfdad 100644
--- a/sim/mcore/interp.c
+++ b/sim/mcore/interp.c
@@ -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);
diff --git a/sim/microblaze/interp.c b/sim/microblaze/interp.c
index f53c1d7..5e701e5 100644
--- a/sim/microblaze/interp.c
+++ b/sim/microblaze/interp.c
@@ -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);
diff --git a/sim/ppc/sim_calls.c b/sim/ppc/sim_calls.c
index 8854445..13e39a6 100644
--- a/sim/ppc/sim_calls.c
+++ b/sim/ppc/sim_calls.c
@@ -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);
diff --git a/sim/rl78/gdb-if.c b/sim/rl78/gdb-if.c
index be93f57..d780bc0 100644
--- a/sim/rl78/gdb-if.c
+++ b/sim/rl78/gdb-if.c
@@ -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);
diff --git a/sim/rx/gdb-if.c b/sim/rx/gdb-if.c
index 5e2ad2f..a2b9218 100644
--- a/sim/rx/gdb-if.c
+++ b/sim/rx/gdb-if.c
@@ -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);
diff --git a/sim/sh/interp.c b/sim/sh/interp.c
index c067f0f..2e2e136 100644
--- a/sim/sh/interp.c
+++ b/sim/sh/interp.c
@@ -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 ();