diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2009-07-18 15:41:02 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2009-07-18 15:41:02 (GMT) |
commit | 3a9fe39c6a8923f45e7c96d80b0bfe52b8686ff9 (patch) | |
tree | 30c3bfa3df145a74d3237513b9eb6dc5559d32be /src/analysis/line.c | |
parent | 10105a5f877fd2c6d1e67343956269f1b19a5133 (diff) |
Computed the end of routines with no limit.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@98 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/line.c')
-rw-r--r-- | src/analysis/line.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/analysis/line.c b/src/analysis/line.c index 740673a..cd54db0 100644 --- a/src/analysis/line.c +++ b/src/analysis/line.c @@ -34,6 +34,7 @@ #include <sys/param.h> +#include "line_code.h" #include "../common/dllist.h" @@ -732,3 +733,47 @@ GRenderingLine *g_rendering_line_find_by_address(GRenderingLine *lines, const GR return result; } + + +/****************************************************************************** +* * +* Paramètres : start = première ligne de l'ensemble à parcourir. * +* last = dernière élément imposé du parcours ou NULL. * +* * +* Description : Donne la première ligne de code correspondant à une adresse. * +* * +* Retour : Ligne de code pour l'adresse donnée, NULL si aucune trouvée. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GRenderingLine *g_rendering_line_loop_for_code(GRenderingLine *start, const GRenderingLine *last) +{ + GRenderingLine *result; /* Trouvaille à retourner */ + vmpa_t reference; /* Adresse à conserver */ + + result = start; + reference = start->offset; + + lines_list_for_each(result, start) + { + if (G_IS_CODE_LINE(result)) break; + + if (result->offset != reference) + { + result = NULL; + break; + } + + if (result == last) + { + result = NULL; + break; + } + + } + + return result; + +} |