summaryrefslogtreecommitdiff
path: root/src/gtkext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2013-02-10 09:56:11 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2013-02-10 09:56:11 (GMT)
commit34e1a14aced520ba06ee1b81cfd7710e97c1643f (patch)
tree2657c22041ab954bb2165553f71141b7843956a2 /src/gtkext
parent3467b0cdb09976faccc6dbef09315cc38dbe6fb5 (diff)
Improved the disassembling process by handling loops in code.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@339 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gtkext')
-rw-r--r--src/gtkext/graph/dot.c2
-rw-r--r--src/gtkext/graph/layout.c8
-rw-r--r--src/gtkext/gtklinkrenderer.c4
-rw-r--r--src/gtkext/gtklinkrenderer.h3
4 files changed, 16 insertions, 1 deletions
diff --git a/src/gtkext/graph/dot.c b/src/gtkext/graph/dot.c
index 64ca2b5..18c4800 100644
--- a/src/gtkext/graph/dot.c
+++ b/src/gtkext/graph/dot.c
@@ -223,6 +223,8 @@ GtkLinkRenderer **create_links_from_graph_layout(const graph_layout *layout, siz
color = LKC_GREEN;
else if (strcmp("red", eiter->attr[attrib->index]) == 0)
color = LKC_RED;
+ else if (strcmp("blue", eiter->attr[attrib->index]) == 0)
+ color = LKC_BLUE;
else if (strcmp("gray", eiter->attr[attrib->index]) == 0)
color = LKC_DASHED_GRAY;
}
diff --git a/src/gtkext/graph/layout.c b/src/gtkext/graph/layout.c
index 87ae2ec..1748c40 100644
--- a/src/gtkext/graph/layout.c
+++ b/src/gtkext/graph/layout.c
@@ -282,6 +282,14 @@ static char *complete_graph_links(const GtkGraphView *view, GtkViewPanel **views
desc = stradd(desc, cmd);
break;
+ case ILT_LOOP:
+ snprintf(cmd, LINKS_DESC_LEN,
+ "_%p:s -> _%p:n [ltail=cluster_%p, lhead=cluster_%p, " \
+ "color=blue];\n",
+ views[i], views[k], views[i], views[k]);
+ desc = stradd(desc, cmd);
+ break;
+
case ILT_CATCH_EXCEPTION:
snprintf(cmd, LINKS_DESC_LEN,
"_%p:s -> _%p:n [ltail=cluster_%p, lhead=cluster_%p, " \
diff --git a/src/gtkext/gtklinkrenderer.c b/src/gtkext/gtklinkrenderer.c
index 0dbdb25..1d4a86d 100644
--- a/src/gtkext/gtklinkrenderer.c
+++ b/src/gtkext/gtklinkrenderer.c
@@ -215,6 +215,9 @@ void _gtk_link_renderer_draw(const GtkLinkRenderer *renderer, cairo_t *cairo, bo
case LKC_RED:
cairo_set_source_rgb(cairo, 0.8, 0, 0);
break;
+ case LKC_BLUE:
+ cairo_set_source_rgb(cairo, 0, 0, 0.8);
+ break;
case LKC_DASHED_GRAY:
cairo_set_source_rgb(cairo, 0.4, 0.4, 0.4);
break;
@@ -226,6 +229,7 @@ void _gtk_link_renderer_draw(const GtkLinkRenderer *renderer, cairo_t *cairo, bo
case LKC_DEFAULT:
case LKC_GREEN:
case LKC_RED:
+ case LKC_BLUE:
cairo_set_dash(cairo, (double []) { 6.0 }, 0, 0.0);
break;
case LKC_DASHED_GRAY:
diff --git a/src/gtkext/gtklinkrenderer.h b/src/gtkext/gtklinkrenderer.h
index ed2699e..7b78e5e 100644
--- a/src/gtkext/gtklinkrenderer.h
+++ b/src/gtkext/gtklinkrenderer.h
@@ -2,7 +2,7 @@
/* OpenIDA - Outil d'analyse de fichiers binaires
* gtklinkrenderer.h - prototypes pour les liens graphiques entre différents morceaux de code
*
- * Copyright (C) 2009 Cyrille Bagard
+ * Copyright (C) 2009-2013 Cyrille Bagard
*
* This file is part of OpenIDA.
*
@@ -52,6 +52,7 @@ typedef enum _LinkColor
LKC_DEFAULT, /* Noir, par défaut */
LKC_GREEN, /* Condition vérifiée */
LKC_RED, /* Condition non vérifiée */
+ LKC_BLUE, /* Boucle détectée */
LKC_DASHED_GRAY, /* Exception omniprésente */
LKC_COUNT