summaryrefslogtreecommitdiff
path: root/src/gtkext/graph
diff options
context:
space:
mode:
Diffstat (limited to 'src/gtkext/graph')
-rw-r--r--src/gtkext/graph/dot.c18
-rw-r--r--src/gtkext/graph/layout.c35
2 files changed, 21 insertions, 32 deletions
diff --git a/src/gtkext/graph/dot.c b/src/gtkext/graph/dot.c
index 4c35089..0e7091e 100644
--- a/src/gtkext/graph/dot.c
+++ b/src/gtkext/graph/dot.c
@@ -25,6 +25,7 @@
#include <malloc.h>
+#include <string.h>
#include <graphviz/gvc.h>
#include <graphviz/types.h>
@@ -210,14 +211,19 @@ GtkLinkRenderer **create_links_from_graph_layout(const graph_layout *layout, siz
/* Détermination de la couleur */
+ color = LKC_DEFAULT;
+
attrib = agfindedgeattr(agraphof(agtail(eiter)), "color");
- if (eiter->attr[attrib->index][0] == 'g') /* "green" */
- color = LKC_GREEN;
- else if (eiter->attr[attrib->index][0] == 'r') /* "red" */
- color = LKC_RED;
- else
- color = LKC_DEFAULT;
+ if (attrib != NULL)
+ {
+ if (strcmp("green", eiter->attr[attrib->index]) == 0)
+ color = LKC_GREEN;
+ else if (strcmp("red", eiter->attr[attrib->index]) == 0)
+ color = LKC_RED;
+ else if (strcmp("gray", eiter->attr[attrib->index]) == 0)
+ color = LKC_DASHED_GRAY;
+ }
/* Raccordement au point de départ */
diff --git a/src/gtkext/graph/layout.c b/src/gtkext/graph/layout.c
index 64a8236..3a2f4e3 100644
--- a/src/gtkext/graph/layout.c
+++ b/src/gtkext/graph/layout.c
@@ -137,7 +137,6 @@ static char *complete_graph_links(const GtkGraphView *view, GtkViewPanel **views
size_t j; /* Boucle de parcours #2 */
size_t k; /* Boucle de parcours #3 */
char cmd[LINKS_DESC_LEN]; /* Tampon pour l'ajout de liens*/
- GArchInstruction *next; /* Instruction suivante */
if (count == 0)
return desc;
@@ -168,6 +167,7 @@ static char *complete_graph_links(const GtkGraphView *view, GtkViewPanel **views
if (k < count)
switch (types[j])
{
+ case ILT_EXEC_FLOW:
case ILT_JUMP:
snprintf(cmd, LINKS_DESC_LEN,
"_%p:s -> _%p:n [ltail=cluster_%p, lhead=cluster_%p];\n",
@@ -191,6 +191,14 @@ static char *complete_graph_links(const GtkGraphView *view, GtkViewPanel **views
desc = stradd(desc, cmd);
break;
+ case ILT_CATCH_EXCEPTION:
+ snprintf(cmd, LINKS_DESC_LEN,
+ "_%p:s -> _%p:n [ltail=cluster_%p, lhead=cluster_%p, " \
+ "color=gray];\n",
+ views[i], views[k], views[i], views[k]);
+ desc = stradd(desc, cmd);
+ break;
+
default:
break;
@@ -200,31 +208,6 @@ static char *complete_graph_links(const GtkGraphView *view, GtkViewPanel **views
}
- /* Sinon on suit le flux normal */
- else
- {
- if (g_arch_instruction_is_return(last))
- continue;
-
- next = g_arch_instruction_get_next_iter(instrs, last, VMPA_MAX);
- if (next == NULL) continue;
-
- g_arch_instruction_get_location(next, NULL, NULL, &addr);
-
- for (k = 0; k < count; k++)
- if (gtk_view_panel_contain_address(views[k], addr))
- break;
-
- if (k < count)
- {
- snprintf(cmd, LINKS_DESC_LEN,
- "_%p:s -> _%p:n [ltail=cluster_%p, lhead=cluster_%p];\n",
- views[i], views[k], views[i], views[k]);
- desc = stradd(desc, cmd);
- }
-
- }
-
}
return desc;