summaryrefslogtreecommitdiff
path: root/src/format/executable.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-09-19 22:28:42 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-09-19 22:28:42 (GMT)
commit0e3059731d9687027c913135b3b856596c49a689 (patch)
treed3c3754f95c90ae50168817e6248afee6873fbf3 /src/format/executable.c
parent18648e4e8763a3bc005d6fae51eae3d1528d7d29 (diff)
Extended the prototype for matching formats in order to get it suitable for plugins.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@577 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/executable.c')
-rw-r--r--src/format/executable.c78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/format/executable.c b/src/format/executable.c
index aae182a..5ff773c 100644
--- a/src/format/executable.c
+++ b/src/format/executable.c
@@ -84,6 +84,84 @@ static void g_executable_format_init(GExeFormat *format)
+/******************************************************************************
+* *
+* Paramètres : format = informations chargées à compléter. *
+* info = informations de débogage à lier. *
+* *
+* Description : Rajoute des informations de débogage à un exécutable. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void g_exe_format_add_debug_info(GExeFormat *format, GDbgFormat *info)
+{
+ /* Ajout dans la liste */
+
+ format->debugs = (GDbgFormat **)realloc(format->debugs,
+ ++format->debugs_count * sizeof(GDbgFormat *));
+
+ format->debugs[format->debugs_count - 1] = info;
+
+ /* Intégration des symboles */
+
+ /* TODO */
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : format = informations chargées à consulter. *
+* *
+* Description : Compte le nombre de formats de débogage liés à l'exécutable. *
+* *
+* Retour : Nombre de formats de débogage attachés. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+size_t g_exe_format_count_debug_info(const GExeFormat *format)
+{
+ return format->debugs_count;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : format = informations chargées à consulter. *
+* index = indice des informations à transmettre. *
+* *
+* Description : Fournit un format de débogage attaché à l'exécutable. *
+* *
+* Retour : Informations de débogage attachées. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GDbgFormat *g_exe_format_get_debug_info(const GExeFormat *format, size_t index)
+{
+ GDbgFormat *result; /* Format à retourner */
+
+ if (index >= format->debugs_count)
+ result = NULL;
+
+ else
+ {
+ result = format->debugs[index];
+ g_object_ref(G_OBJECT(result));
+ }
+
+ return result;
+
+}
+