summaryrefslogtreecommitdiff
path: root/src/format/format.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-07-08 21:54:13 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-07-08 21:54:13 (GMT)
commit21af77b7c44126c05b62319f99a679fc748b579e (patch)
tree07414fb7bb16cf60e2e827b507d1e5ffbb623414 /src/format/format.c
parent6f3c4bc6ec571dcca8e25b9f82a0c2e72310900c (diff)
Cleaned the demangling system.
Diffstat (limited to 'src/format/format.c')
-rw-r--r--src/format/format.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/format/format.c b/src/format/format.c
index 439bd3e..5ff08e6 100644
--- a/src/format/format.c
+++ b/src/format/format.c
@@ -477,6 +477,77 @@ void g_binary_format_complete_analysis(GBinFormat *format, wgroup_id_t gid, GtkS
/* ---------------------------------------------------------------------------------- */
+/* DECODAGE DE SYMBOLES */
+/* ---------------------------------------------------------------------------------- */
+
+
+/******************************************************************************
+* *
+* Paramètres : format = format binaire à consulter pour l'opération. *
+* desc = chaîne de caractères à décoder. *
+* *
+* Description : Décode une chaîne de caractères donnée en type. *
+* *
+* Retour : Instance obtenue ou NULL en cas d'échec. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GDataType *g_binary_format_decode_type(const GBinFormat *format, const char *desc)
+{
+ GDataType *result; /* Construction à remonter */
+ GCompDemangler *demangler; /* Accès plus lisible */
+
+ demangler = G_BIN_FORMAT(format)->demangler;
+
+ if (demangler != NULL)
+ result = g_compiler_demangler_decode_type(demangler, desc);
+ else
+ result = NULL;
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : format = format binaire à consulter pour l'opération. *
+* desc = chaîne de caractères à décoder. *
+* *
+* Description : Décode une chaîne de caractères donnée en routine. *
+* *
+* Retour : Instance obtenue ou NULL en cas d'échec. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GBinRoutine *g_binary_format_decode_routine(const GBinFormat *format, const char *desc)
+{
+ GBinRoutine *result; /* Construction à remonter */
+ GCompDemangler *demangler; /* Accès plus lisible */
+
+ demangler = G_BIN_FORMAT(format)->demangler;
+
+ if (demangler != NULL)
+ result = g_compiler_demangler_decode_routine(demangler, desc);
+ else
+ result = NULL;
+
+ if (result == NULL)
+ {
+ result = g_binary_routine_new();
+ g_binary_routine_set_name(result, strdup(desc));
+ }
+
+ return result;
+
+}
+
+
+/* ---------------------------------------------------------------------------------- */
/* RASSEMBLEMENT ET GESTION DE SYMBOLES */
/* ---------------------------------------------------------------------------------- */