summaryrefslogtreecommitdiff
path: root/plugins/devdbg
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-04-04 21:57:54 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-04-04 21:57:54 (GMT)
commit286ba13e0a5e908f9ebe67286bb6006adb4102fc (patch)
tree06d1ef353ae623c579a8fff5a74d22ecc0b9b862 /plugins/devdbg
parentc1cac2ce69f01deb99c5c91a803dfa04af90ef14 (diff)
Simplified the plugin interface.
Diffstat (limited to 'plugins/devdbg')
-rw-r--r--plugins/devdbg/Makefile.am3
-rw-r--r--plugins/devdbg/speed.c24
-rw-r--r--plugins/devdbg/speed.h4
3 files changed, 16 insertions, 15 deletions
diff --git a/plugins/devdbg/Makefile.am b/plugins/devdbg/Makefile.am
index 90553c8..2877411 100644
--- a/plugins/devdbg/Makefile.am
+++ b/plugins/devdbg/Makefile.am
@@ -7,7 +7,8 @@ libdir = $(pluginslibdir)
libspeed_la_SOURCES = \
speed.h speed.c
-libspeed_la_LDFLAGS = -L$(top_srcdir)/src/.libs -lchrysacore
+libspeed_la_LDFLAGS = \
+ -L$(top_srcdir)/src/.libs -lchrysacore
devdir = $(includedir)/chrysalide-$(subdir)
diff --git a/plugins/devdbg/speed.c b/plugins/devdbg/speed.c
index 6b9cc6b..1378c66 100644
--- a/plugins/devdbg/speed.c
+++ b/plugins/devdbg/speed.c
@@ -34,11 +34,12 @@
#include <common/extstr.h>
-#include <plugins/plugin-def.h>
+#include <plugins/self.h>
-DEFINE_CHRYSALIDE_PLUGIN("GSpeedPlugin", "Speed Measure", "Tracks to time spent for disassembling code", "0.1.0",
+DEFINE_CHRYSALIDE_PLUGIN("SpeedMeasure", "Tracker of time spent for disassembling code",
+ PACKAGE_VERSION, CHRYSALIDE_WEBSITE(""),
NO_REQ, AL(PGA_FORMAT_ANALYSIS_STARTED,PGA_FORMAT_ANALYSIS_ENDED,
PGA_FORMAT_POST_ANALYSIS_STARTED, PGA_FORMAT_POST_ANALYSIS_ENDED,
PGA_DISASSEMBLY_STARTED, PGA_DISASSEMBLY_ENDED));
@@ -53,14 +54,13 @@ typedef struct _speed_measure
/* Affiche une mesure de temps écoulé. */
-static void show_elapsed_time(const GPluginModule *, const char *, const speed_measure *);
+static void show_elapsed_time(const char *, const speed_measure *);
/******************************************************************************
* *
-* Paramètres : plugin = greffon à manipuler. *
-* title = désignation humaine de la mesure menée. *
+* Paramètres : title = désignation humaine de la mesure menée. *
* measure = mesure de temps écoulé. *
* *
* Description : Affiche une mesure de temps écoulé. *
@@ -71,7 +71,7 @@ static void show_elapsed_time(const GPluginModule *, const char *, const speed_m
* *
******************************************************************************/
-static void show_elapsed_time(const GPluginModule *plugin, const char *title, const speed_measure *measure)
+static void show_elapsed_time(const char *title, const speed_measure *measure)
{
char *tmp; /* Construction temporaire */
double seconds; /* Secondes écoulées */
@@ -132,7 +132,7 @@ static void show_elapsed_time(const GPluginModule *plugin, const char *title, co
}
if (tmp != NULL)
- g_plugin_module_log_simple_message(plugin, LMT_INFO, msg);
+ log_plugin_simple_message(LMT_INFO, msg);
free(msg);
@@ -155,7 +155,7 @@ static void show_elapsed_time(const GPluginModule *plugin, const char *title, co
* *
******************************************************************************/
-G_MODULE_EXPORT bool handle_binary_format_analysis(const GPluginModule *plugin, PluginAction action, GBinFormat *format, wgroup_id_t gid, GtkStatusStack *status)
+G_MODULE_EXPORT bool chrysalide_plugin_handle_binary_format_analysis(const GPluginModule *plugin, PluginAction action, GBinFormat *format, wgroup_id_t gid, GtkStatusStack *status)
{
speed_measure *measure; /* Suivi des progressions */
struct timeval point; /* Point de mesure courant */
@@ -182,9 +182,9 @@ G_MODULE_EXPORT bool handle_binary_format_analysis(const GPluginModule *plugin,
measure->usages[1] = point.tv_sec * 1000000 + point.tv_usec;
if (action == PGA_FORMAT_ANALYSIS_ENDED)
- show_elapsed_time(plugin, _("Whole elapsed time for format analysis:"), measure);
+ show_elapsed_time(_("Whole elapsed time for format analysis:"), measure);
else
- show_elapsed_time(plugin, _("Whole elapsed time for format post-analysis:"), measure);
+ show_elapsed_time(_("Whole elapsed time for format post-analysis:"), measure);
g_object_set_data(G_OBJECT(format), "speed_measure", NULL);
free(measure);
@@ -218,7 +218,7 @@ G_MODULE_EXPORT bool handle_binary_format_analysis(const GPluginModule *plugin,
* *
******************************************************************************/
-G_MODULE_EXPORT void process_binary_disassembly(const GPluginModule *plugin, PluginAction action, GLoadedBinary *binary, GtkStatusStack *status, GProcContext *context)
+G_MODULE_EXPORT void chrysalide_plugin_process_binary_disassembly(const GPluginModule *plugin, PluginAction action, GLoadedBinary *binary, GtkStatusStack *status, GProcContext *context)
{
speed_measure *measure; /* Suivi des progressions */
struct timeval point; /* Point de mesure courant */
@@ -242,7 +242,7 @@ G_MODULE_EXPORT void process_binary_disassembly(const GPluginModule *plugin, Plu
gettimeofday(&point, NULL);
measure->usages[1] = point.tv_sec * 1000000 + point.tv_usec;
- show_elapsed_time(plugin, _("Whole elapsed time for disassembly:"), measure);
+ show_elapsed_time(_("Whole elapsed time for disassembly:"), measure);
g_object_set_data(G_OBJECT(binary), "speed_measure", NULL);
free(measure);
diff --git a/plugins/devdbg/speed.h b/plugins/devdbg/speed.h
index dff6a93..7d591fb 100644
--- a/plugins/devdbg/speed.h
+++ b/plugins/devdbg/speed.h
@@ -31,10 +31,10 @@
/* Procède à une opération liée à l'analyse d'un format. */
-G_MODULE_EXPORT bool handle_binary_format_analysis(const GPluginModule *, PluginAction, GBinFormat *, wgroup_id_t, GtkStatusStack *);
+G_MODULE_EXPORT bool chrysalide_plugin_handle_binary_format_analysis(const GPluginModule *, PluginAction, GBinFormat *, wgroup_id_t, GtkStatusStack *);
/* Exécute une action pendant un désassemblage de binaire. */
-G_MODULE_EXPORT void process_binary_disassembly(const GPluginModule *, PluginAction , GLoadedBinary *, GtkStatusStack *, GProcContext *);
+G_MODULE_EXPORT void chrysalide_plugin_process_binary_disassembly(const GPluginModule *, PluginAction , GLoadedBinary *, GtkStatusStack *, GProcContext *);