summaryrefslogtreecommitdiff
path: root/plugins/readelf
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-09-11 21:37:36 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-09-11 21:37:36 (GMT)
commit0f1473cba267ad809c8e7d207b5ff5e3998745fc (patch)
tree8aea43688d78c10ee7758e2feed80be9abbfaaf6 /plugins/readelf
parentfe39a487b4db5564036a436bfcb7cf3561889fb5 (diff)
Displayed more details about the loading process in the status bar.
Diffstat (limited to 'plugins/readelf')
-rw-r--r--plugins/readelf/program.c13
-rw-r--r--plugins/readelf/program.h2
-rw-r--r--plugins/readelf/reader.c7
-rw-r--r--plugins/readelf/reader.h2
-rw-r--r--plugins/readelf/section.c13
-rw-r--r--plugins/readelf/section.h2
6 files changed, 31 insertions, 8 deletions
diff --git a/plugins/readelf/program.c b/plugins/readelf/program.c
index f380ce4..0c6574d 100644
--- a/plugins/readelf/program.c
+++ b/plugins/readelf/program.c
@@ -325,6 +325,7 @@ static bool annotate_elf_program_header(GElfFormat *format, SourceEndian endian,
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* status = barre de statut à tenir informée. *
* *
* Description : Charge tous les symboles liés aux en-têtes de programme ELF. *
* *
@@ -334,7 +335,7 @@ static bool annotate_elf_program_header(GElfFormat *format, SourceEndian endian,
* *
******************************************************************************/
-bool annotate_elf_program_header_table(GElfFormat *format)
+bool annotate_elf_program_header_table(GElfFormat *format, GtkStatusStack *status)
{
bool result; /* Bilan à retourner */
const elf_header *header; /* En-tête principale */
@@ -342,6 +343,7 @@ bool annotate_elf_program_header_table(GElfFormat *format)
phys_t offset; /* Tête de lecture du bbinaire */
vmpa2t pos; /* Localisation des symboles */
uint16_t e_phnum; /* Nombre d'éléments 'Program' */
+ activity_id_t msg; /* Message de progression */
uint16_t i; /* Boucle de parcours */
result = true;
@@ -356,9 +358,18 @@ bool annotate_elf_program_header_table(GElfFormat *format)
e_phnum = ELF_HDR(format, *header, e_phnum);
+ msg = gtk_status_stack_add_activity(status, _("Writing annotations for all Elf program headers..."), e_phnum);
+
for (i = 0; i < e_phnum && result; i++)
+ {
result = annotate_elf_program_header(format, endian, &pos);
+ gtk_status_stack_update_activity_value(status, msg, 1);
+
+ }
+
+ gtk_status_stack_remove_activity(status, msg);
+
return true;
}
diff --git a/plugins/readelf/program.h b/plugins/readelf/program.h
index b1f3a6d..1ff26b5 100644
--- a/plugins/readelf/program.h
+++ b/plugins/readelf/program.h
@@ -30,7 +30,7 @@
/* Charge tous les symboles liés aux en-têtes de programme ELF. */
-bool annotate_elf_program_header_table(GElfFormat *);
+bool annotate_elf_program_header_table(GElfFormat *, GtkStatusStack *);
diff --git a/plugins/readelf/reader.c b/plugins/readelf/reader.c
index 2d10540..875b568 100644
--- a/plugins/readelf/reader.c
+++ b/plugins/readelf/reader.c
@@ -42,6 +42,7 @@ DEFINE_CHRYSALIDE_ACTIVE_PLUGIN("readelf", "Displays information about ELF files
* Paramètres : plugin = greffon à manipuler. *
* action = type d'action attendue. *
* format = description de l'exécutable à compléter. *
+* status = barre de statut à tenir informée. *
* *
* Description : Etablit des symboles complémentaires dans un format ELF. *
* *
@@ -51,7 +52,7 @@ DEFINE_CHRYSALIDE_ACTIVE_PLUGIN("readelf", "Displays information about ELF files
* *
******************************************************************************/
-G_MODULE_EXPORT bool handle_binary_format(const GPluginModule *plugin, PluginAction action, GBinFormat *format)
+G_MODULE_EXPORT bool handle_binary_format(const GPluginModule *plugin, PluginAction action, GBinFormat *format, GtkStatusStack *status)
{
bool result; /* Bilan à retourner */
GElfFormat *elf_fmt; /* Version ELF */
@@ -66,9 +67,9 @@ G_MODULE_EXPORT bool handle_binary_format(const GPluginModule *plugin, PluginAct
result = annotate_elf_header(elf_fmt);
- result &= annotate_elf_program_header_table(elf_fmt);
+ result &= annotate_elf_program_header_table(elf_fmt, status);
- result &= annotate_elf_section_header_table(elf_fmt);
+ result &= annotate_elf_section_header_table(elf_fmt, status);
hbf_exit:
diff --git a/plugins/readelf/reader.h b/plugins/readelf/reader.h
index 0080766..00f81d1 100644
--- a/plugins/readelf/reader.h
+++ b/plugins/readelf/reader.h
@@ -32,7 +32,7 @@
/* Etablit des symboles complémentaires dans un format ELF. */
-G_MODULE_EXPORT bool handle_binary_format(const GPluginModule *, PluginAction, GBinFormat *);
+G_MODULE_EXPORT bool handle_binary_format(const GPluginModule *, PluginAction, GBinFormat *, GtkStatusStack *);
diff --git a/plugins/readelf/section.c b/plugins/readelf/section.c
index bae4b4c..f7aa727 100644
--- a/plugins/readelf/section.c
+++ b/plugins/readelf/section.c
@@ -399,6 +399,7 @@ static bool annotate_elf_section_header(GElfFormat *format, SourceEndian endian,
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* status = barre de statut à tenir informée. *
* *
* Description : Charge tous les symboles liés aux en-têtes de section ELF. *
* *
@@ -408,7 +409,7 @@ static bool annotate_elf_section_header(GElfFormat *format, SourceEndian endian,
* *
******************************************************************************/
-bool annotate_elf_section_header_table(GElfFormat *format)
+bool annotate_elf_section_header_table(GElfFormat *format, GtkStatusStack *status)
{
bool result; /* Bilan à retourner */
const elf_header *header; /* En-tête principale */
@@ -417,6 +418,7 @@ bool annotate_elf_section_header_table(GElfFormat *format)
off_t offset; /* Tête de lecture du binaire */
vmpa2t pos; /* Localisation des symboles */
uint16_t e_shnum; /* Nombre d'éléments 'Program' */
+ activity_id_t msg; /* Message de progression */
uint16_t i; /* Boucle de parcours */
result = true;
@@ -433,9 +435,18 @@ bool annotate_elf_section_header_table(GElfFormat *format)
e_shnum = ELF_HDR(format, *header, e_shnum);
+ msg = gtk_status_stack_add_activity(status, _("Writing annotations for all Elf section headers..."), e_shnum);
+
for (i = 0; i < e_shnum && result; i++)
+ {
result = annotate_elf_section_header(format, endian, &strings, &pos);
+ gtk_status_stack_update_activity_value(status, msg, 1);
+
+ }
+
+ gtk_status_stack_remove_activity(status, msg);
+
return true;
}
diff --git a/plugins/readelf/section.h b/plugins/readelf/section.h
index ab0e50b..a40c5c5 100644
--- a/plugins/readelf/section.h
+++ b/plugins/readelf/section.h
@@ -30,7 +30,7 @@
/* Charge tous les symboles liés aux en-têtes de section ELF. */
-bool annotate_elf_section_header_table(GElfFormat *);
+bool annotate_elf_section_header_table(GElfFormat *, GtkStatusStack *);