summaryrefslogtreecommitdiff
path: root/src/analysis/routine.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2013-01-01 23:29:57 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2013-01-01 23:29:57 (GMT)
commitbfd81d1f289913f4d6e09cd8d99f4aaeed98436b (patch)
treeefc747ec80f83fc248da1e8e4ac06c4e7d3347dd /src/analysis/routine.c
parentbb6d0c758f8c720d8074bf74e6bd001e36d6a918 (diff)
Fixed the computing of basic blocks and used them in graphic views.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@316 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/routine.c')
-rw-r--r--src/analysis/routine.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/analysis/routine.c b/src/analysis/routine.c
index d52b74a..048d11a 100644
--- a/src/analysis/routine.c
+++ b/src/analysis/routine.c
@@ -57,6 +57,7 @@ struct _GBinRoutine
size_t locals_count; /* Nombre de variables locales */
GArchInstruction *instr; /* Instructions natives */
+ GInstrBlock *blocks; /* Blocs basiques d'instruct° */
GDecInstruction *dinstr; /* Instructions décompilées */
};
@@ -800,6 +801,48 @@ void g_binary_routine_set_instructions(GBinRoutine *routine, GArchInstruction *i
* *
* Paramètres : routine = routine à consulter. *
* *
+* Description : Fournit les blocs basiques de la routine. *
+* *
+* Retour : Ensemble de blocs déterminés via les instructions. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GInstrBlock *g_binary_routine_get_basic_blocks(const GBinRoutine *routine)
+{
+ return routine->blocks;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : routine = routine à mettre à jour. *
+* blocks = ensemble de blocs déterminés via les instructions. *
+* *
+* Description : Définit les blocs basiques de la routine. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void g_binary_routine_set_basic_blocks(GBinRoutine *routine, GInstrBlock *blocks)
+{
+ if (routine->blocks != NULL)
+ g_object_unref(G_OBJECT(routine->blocks));
+
+ routine->blocks = blocks;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : routine = routine à consulter. *
+* *
* Description : Fournit les instructions décompilées correspondantes. *
* *
* Retour : Ensemble d'instructions décompilées ou NULL. *