summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis')
-rw-r--r--src/analysis/block-int.h12
-rw-r--r--src/analysis/block.c16
-rw-r--r--src/analysis/blocks/flow.c18
-rw-r--r--src/analysis/blocks/virtual.c17
4 files changed, 26 insertions, 37 deletions
diff --git a/src/analysis/block-int.h b/src/analysis/block-int.h
index 18b1ce4..ce401ae 100644
--- a/src/analysis/block-int.h
+++ b/src/analysis/block-int.h
@@ -52,12 +52,6 @@ struct _GInstrBlock
{
GObject parent; /* A laisser en premier */
- find_by_addr_fc find_by_addr; /* Recherche par adresse */
- visit_all_blocks_fc visit_blocks; /* Visite des différents blocs */
- list_all_blocks_fc list_blocks; /* Liste de tous les blocs */
- list_leafs_blocks_fc list_leafs; /* Liste des blocs terminaux */
- //list_regs_accesses_fc list_regs; /* Liste des accès registres */
-
GInstrBlock *links_block; /* Lieu des blocs attachés */
};
@@ -67,6 +61,12 @@ struct _GInstrBlockClass
{
GObjectClass parent; /* A laisser en premier */
+ find_by_addr_fc find_by_addr; /* Recherche par adresse */
+ visit_all_blocks_fc visit_blocks; /* Visite des différents blocs */
+ list_all_blocks_fc list_blocks; /* Liste de tous les blocs */
+ list_leafs_blocks_fc list_leafs; /* Liste des blocs terminaux */
+ //list_regs_accesses_fc list_regs; /* Liste des accès registres */
+
};
diff --git a/src/analysis/block.c b/src/analysis/block.c
index 23fbfc5..e906d36 100644
--- a/src/analysis/block.c
+++ b/src/analysis/block.c
@@ -42,14 +42,6 @@ static void g_instr_block_finalize(GInstrBlock *);
-
-
-
-
-
-
-
-
/* Indique le type défini pour un bloc d'instructions. */
G_DEFINE_TYPE(GInstrBlock, g_instr_block, G_TYPE_OBJECT);
@@ -153,7 +145,7 @@ static void g_instr_block_finalize(GInstrBlock *block)
GInstrBlock *g_instr_block_find_by_addr(const GInstrBlock *block, const vmpa2t *addr, bool final)
{
- return block->find_by_addr(block, addr, final);
+ return G_INSTR_BLOCK_GET_CLASS(block)->find_by_addr(block, addr, final);
}
@@ -174,7 +166,7 @@ GInstrBlock *g_instr_block_find_by_addr(const GInstrBlock *block, const vmpa2t *
bool g_instr_block_visit(GInstrBlock *block, instr_block_visitor_cb callback, void *data)
{
- return block->visit_blocks(block, callback, data);
+ return G_INSTR_BLOCK_GET_CLASS(block)->visit_blocks(block, callback, data);
}
@@ -195,7 +187,7 @@ bool g_instr_block_visit(GInstrBlock *block, instr_block_visitor_cb callback, vo
void g_instr_block_list_all_blocks(const GInstrBlock *block, GInstrBlock ***list, size_t *count)
{
- block->list_blocks(block, list, count);
+ G_INSTR_BLOCK_GET_CLASS(block)->list_blocks(block, list, count);
}
@@ -216,7 +208,7 @@ void g_instr_block_list_all_blocks(const GInstrBlock *block, GInstrBlock ***list
void g_instr_block_list_leafs_blocks(const GInstrBlock *block, GInstrBlock ***list, size_t *count)
{
- block->list_leafs(block, list, count);
+ G_INSTR_BLOCK_GET_CLASS(block)->list_leafs(block, list, count);
}
diff --git a/src/analysis/blocks/flow.c b/src/analysis/blocks/flow.c
index 305dad0..99d4553 100644
--- a/src/analysis/blocks/flow.c
+++ b/src/analysis/blocks/flow.c
@@ -111,12 +111,20 @@ G_DEFINE_TYPE(GFlowBlock, g_flow_block, G_TYPE_INSTR_BLOCK);
static void g_flow_block_class_init(GFlowBlockClass *class)
{
GObjectClass *object; /* Autre version de la classe */
+ GInstrBlockClass *block_class; /* Version parente du la classe*/
object = G_OBJECT_CLASS(class);
+ block_class = G_INSTR_BLOCK_CLASS(class);
object->dispose = (GObjectFinalizeFunc/* ! */)g_flow_block_dispose;
object->finalize = (GObjectFinalizeFunc)g_flow_block_finalize;
+ block_class->find_by_addr = (find_by_addr_fc)g_flow_block_find_by_addr;
+ block_class->visit_blocks = (visit_all_blocks_fc)g_flow_block_visit;
+ block_class->list_blocks = (list_all_blocks_fc)g_flow_block_list_all_blocks;
+ block_class->list_leafs = (list_leafs_blocks_fc)g_flow_block_list_leafs_blocks;
+ //block_class->list_regs = (list_regs_accesses_fc)g_flow_block_list_regs_accesses;
+
}
@@ -134,16 +142,6 @@ static void g_flow_block_class_init(GFlowBlockClass *class)
static void g_flow_block_init(GFlowBlock *block)
{
- GInstrBlock *parent; /* Instance parente */
-
- parent = G_INSTR_BLOCK(block);
-
- parent->find_by_addr = (find_by_addr_fc)g_flow_block_find_by_addr;
- parent->visit_blocks = (visit_all_blocks_fc)g_flow_block_visit;
- parent->list_blocks = (list_all_blocks_fc)g_flow_block_list_all_blocks;
- parent->list_leafs = (list_leafs_blocks_fc)g_flow_block_list_leafs_blocks;
- //parent->list_regs = (list_regs_accesses_fc)g_flow_block_list_regs_accesses;
-
g_flow_block_set_rank(block, 0);
block->regs = g_raccess_list_new();
diff --git a/src/analysis/blocks/virtual.c b/src/analysis/blocks/virtual.c
index a3e1695..d5b1b5a 100644
--- a/src/analysis/blocks/virtual.c
+++ b/src/analysis/blocks/virtual.c
@@ -107,12 +107,20 @@ G_DEFINE_TYPE(GVirtualBlock, g_virtual_block, G_TYPE_INSTR_BLOCK);
static void g_virtual_block_class_init(GVirtualBlockClass *class)
{
GObjectClass *object; /* Autre version de la classe */
+ GInstrBlockClass *block_class; /* Version parente du la classe*/
object = G_OBJECT_CLASS(class);
+ block_class = G_INSTR_BLOCK_CLASS(class);
object->dispose = (GObjectFinalizeFunc/* ! */)g_virtual_block_dispose;
object->finalize = (GObjectFinalizeFunc)g_virtual_block_finalize;
+ block_class->find_by_addr = (find_by_addr_fc)g_virtual_block_find_by_addr;
+ block_class->visit_blocks = (visit_all_blocks_fc)g_virtual_block_visit;
+ block_class->list_blocks = (list_all_blocks_fc)g_virtual_block_list_all_blocks;
+ block_class->list_leafs = (list_leafs_blocks_fc)g_virtual_block_list_leafs_blocks;
+ //block_class->list_regs = (list_regs_accesses_fc)g_virtual_block_list_regs_accesses;
+
}
@@ -130,15 +138,6 @@ static void g_virtual_block_class_init(GVirtualBlockClass *class)
static void g_virtual_block_init(GVirtualBlock *block)
{
- GInstrBlock *parent; /* Instance parente */
-
- parent = G_INSTR_BLOCK(block);
-
- parent->find_by_addr = (find_by_addr_fc)g_virtual_block_find_by_addr;
- parent->visit_blocks = (visit_all_blocks_fc)g_virtual_block_visit;
- parent->list_blocks = (list_all_blocks_fc)g_virtual_block_list_all_blocks;
- parent->list_leafs = (list_leafs_blocks_fc)g_virtual_block_list_leafs_blocks;
- //parent->list_regs = (list_regs_accesses_fc)g_virtual_block_list_regs_accesses;
}