[binutils-gdb] sim: move trace init to dynamic modules.c

Michael Frysinger vapier@sourceware.org
Wed Jun 30 16:37:54 GMT 2021


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0ecdca38bc62f60f961ab4d14c711b4c9ffd00e7

commit 0ecdca38bc62f60f961ab4d14c711b4c9ffd00e7
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sun Jun 13 22:42:49 2021 -0400

    sim: move trace init to dynamic modules.c
    
    Use the new modules.c framework to find & initialize this module.

Diff:
---
 sim/common/ChangeLog    | 7 +++++++
 sim/common/sim-module.c | 3 ---
 sim/common/sim-trace.c  | 6 ++++--
 sim/common/sim-trace.h  | 3 ---
 4 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 5211321b949..ee6d97daf76 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,10 @@
+2021-06-30  Mike Frysinger  <vapier@gentoo.org>
+
+	* sim-module.c (early_modules): Delete trace_install.
+	* sim-trace.c (trace_install): Rename to ...
+	(sim_install_trace): ... this.  New prototype.
+	* sim-trace.h (trace_install): Delete.
+
 2021-06-30  Mike Frysinger  <vapier@gentoo.org>
 
 	* sim-engine.c (sim_engine_install): Rename to ...
diff --git a/sim/common/sim-module.c b/sim/common/sim-module.c
index f4b74fcfe3a..d9d08043828 100644
--- a/sim/common/sim-module.c
+++ b/sim/common/sim-module.c
@@ -37,9 +37,6 @@ static MODULE_INSTALL_FN * const early_modules[] = {
   standard_install,
   sim_events_install,
   sim_model_install,
-#if WITH_TRACE_ANY_P
-  trace_install,
-#endif
 #if WITH_PROFILE
   profile_install,
 #endif
diff --git a/sim/common/sim-trace.c b/sim/common/sim-trace.c
index 2c3798933db..9ebb86d70e2 100644
--- a/sim/common/sim-trace.c
+++ b/sim/common/sim-trace.c
@@ -436,10 +436,12 @@ trace_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt,
   return SIM_RC_OK;
 }
 
-/* Install tracing support.  */
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+SIM_RC sim_install_trace (SIM_DESC sd);
 
+/* Install tracing support.  */
 SIM_RC
-trace_install (SIM_DESC sd)
+sim_install_trace (SIM_DESC sd)
 {
   int i;
 
diff --git a/sim/common/sim-trace.h b/sim/common/sim-trace.h
index c89084e9440..c73dc6d367d 100644
--- a/sim/common/sim-trace.h
+++ b/sim/common/sim-trace.h
@@ -142,9 +142,6 @@ enum {
 #define WITH_TRACE_SYSCALL_P	WITH_TRACE_P (TRACE_SYSCALL_IDX)
 #define WITH_TRACE_REGISTER_P	WITH_TRACE_P (TRACE_REGISTER_IDX)
 #define WITH_TRACE_DEBUG_P	WITH_TRACE_P (TRACE_DEBUG_IDX)
-
-/* Tracing install handler.  */
-MODULE_INSTALL_FN trace_install;
 
 /* Struct containing all system and cpu trace data.


More information about the Gdb-cvs mailing list