summaryrefslogtreecommitdiff
path: root/src/gtkext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-04-25 21:35:19 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-04-25 21:35:19 (GMT)
commitee0ff01247738e847ae3faa44dcb5168d7b758ba (patch)
treee945f95a84a97237debf0b16ee11ed95d6862afb /src/gtkext
parent2a1dd967d3b4e06f504431f9d3d613992095b2c3 (diff)
Registered suitable linkage hooks and defined right links between instructions.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@519 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gtkext')
-rw-r--r--src/gtkext/graph/layout.c36
-rw-r--r--src/gtkext/graph/nodes/flow.c19
-rw-r--r--src/gtkext/graph/nodes/flow.h3
3 files changed, 56 insertions, 2 deletions
diff --git a/src/gtkext/graph/layout.c b/src/gtkext/graph/layout.c
index de83a22..d2e3b51 100644
--- a/src/gtkext/graph/layout.c
+++ b/src/gtkext/graph/layout.c
@@ -169,7 +169,8 @@ static void g_graph_layout_finalize(GGraphLayout *layout)
* Remarques : - *
* *
******************************************************************************/
-
+#include "../../arch/instruction-int.h" // REMME
+#include "nodes/flow.h"
GGraphLayout *g_graph_layout_new(GInstrBlock *blocks, GtkBufferView **views, size_t count)
{
GGraphLayout *result; /* Structure à retourner */
@@ -222,18 +223,49 @@ GGraphLayout *g_graph_layout_new(GInstrBlock *blocks, GtkBufferView **views, siz
bool _print_dbg_ext_cb(GGraphNode *node, GNodeVisitState state, int *depth)
{
int i;
+ PendingPositionFlags pending_flag;
+ char *flags;
GtkAllocation alloc;
+ GArchInstruction *first;
+ GArchInstruction *last;
+
+ char *flags_list[] = {
+ "NONE",
+ "DIRECT_X",
+ "LEFT_MARGIN",
+ "RIGHT_MARGIN",
+ "LEFT_NODE",
+ "RIGHT_NODE"
+ };
+
if (state == GVS_ENTER || state == GVS_NODE)
{
+
+
+
for (i = 0; i < *depth; i++)
printf(" ");
+ g_graph_node_get_pending_position(node, &pending_flag, (pending_position []) { { 0 } });
+ flags = flags_list[pending_flag];
+
alloc = g_graph_node_get_allocation(node);
- printf("- %p - (%d ; %d) - (%d ; %d)\n", node,
+ printf("- %p - \"%s\" - (%d ; %d) - (%d ; %d)", node,
+ flags,
alloc.x, alloc.y,
alloc.width, alloc.height);
+ if (G_IS_FLOW_NODE(node))
+ {
+ printf(" - rank = %u -", g_graph_node_get_rank(node));
+
+ g_flow_block_get_boundary(g_flow_node_get_block(node), &first, &last);
+ printf(" - 0x%08x <-> 0x%08x", first->range.addr.virtual, last->range.addr.virtual);
+ }
+
+ printf("\n");
+
}
if (state == GVS_ENTER) (*depth)++;
diff --git a/src/gtkext/graph/nodes/flow.c b/src/gtkext/graph/nodes/flow.c
index 558913e..e502293 100644
--- a/src/gtkext/graph/nodes/flow.c
+++ b/src/gtkext/graph/nodes/flow.c
@@ -462,6 +462,25 @@ static bool g_flow_node_visit_flow_nodes(GFlowNode *node, graph_node_visitor_cb
/******************************************************************************
* *
+* Paramètres : node = noeud graphique à consulter. *
+* *
+* Description : Fournit le bloc basique à l'origine du bloc graphique. *
+* *
+* Retour : Bloc brut encapsulé. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GFlowBlock *g_flow_node_get_block(const GFlowNode *node)
+{
+ return node->block;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : node = noeud graphique à consulter. *
* instr = instruction à considérer. *
* *
diff --git a/src/gtkext/graph/nodes/flow.h b/src/gtkext/graph/nodes/flow.h
index 413a8f2..f659a77 100644
--- a/src/gtkext/graph/nodes/flow.h
+++ b/src/gtkext/graph/nodes/flow.h
@@ -59,6 +59,9 @@ GType g_flow_node_get_type(void);
/* Encapsule graphiquement un bloc d'exécution. */
GGraphNode *g_flow_node_new(GFlowBlock *, GtkBufferView *);
+/* Fournit le bloc basique à l'origine du bloc graphique. */
+GFlowBlock *g_flow_node_get_block(const GFlowNode *);
+
/* Précise si le noeud a pour première instruction celle donnée. */
bool g_flow_node_start_with(const GFlowNode *, GArchInstruction *);