diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2014-09-17 21:36:49 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2014-09-17 21:36:49 (GMT) |
commit | 65768127dea4c2760fe07cf843da7b4ad9e67da5 (patch) | |
tree | d0023eb7f378a4118fd074f3f61d5eae02e0882b /src/format/symbol.c | |
parent | af083f8bd6da340214ae392451dde5782fb79039 (diff) |
Introduced memory ranges.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@406 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/symbol.c')
-rw-r--r-- | src/format/symbol.c | 48 |
1 files changed, 5 insertions, 43 deletions
diff --git a/src/format/symbol.c b/src/format/symbol.c index 5b80555..0875e1f 100644 --- a/src/format/symbol.c +++ b/src/format/symbol.c @@ -192,32 +192,29 @@ vmpa_t g_binary_symbol_get_address(const GBinSymbol *symbol) /****************************************************************************** * * * Paramètres : symbol = symbole à venir consulter. * -* length = taille de l'instruction ou NULL. [OUT] * * * * Description : Fournit l'emplacement où se situe un symbole. * * * -* Retour : Adresse virtuelle ou physique associée. * +* Retour : Zone mémoire couverte par le symbole. * * * * Remarques : - * * * ******************************************************************************/ -const vmpa2t *g_binary_symbol_get_location(const GBinSymbol *symbol, off_t *length) +const mrange_t *g_binary_symbol_get_range(const GBinSymbol *symbol) { - const vmpa2t *result; /* Localisation à retourner */ + const mrange_t *result; /* Plage à retourner */ result = NULL; switch (symbol->type) { case STP_DATA: - result = g_arch_instruction_get_location2(symbol->extra.instr, length); + result = g_arch_instruction_get_range(symbol->extra.instr); break; case STP_ROUTINE: - result = g_binary_routine_get_address(symbol->extra.routine); - if (length != NULL) - *length = g_binary_routine_get_size(symbol->extra.routine); + result = g_binary_routine_get_range(symbol->extra.routine); break; default: @@ -234,41 +231,6 @@ const vmpa2t *g_binary_symbol_get_location(const GBinSymbol *symbol, off_t *leng /****************************************************************************** * * * Paramètres : symbol = symbole à venir consulter. * -* * -* Description : Fournit la taille officielle d'un symbole. * -* * -* Retour : Taille de symbole. * -* * -* Remarques : - * -* * -******************************************************************************/ - -off_t g_binary_symbol_get_size(const GBinSymbol *symbol) -{ - off_t result; /* Taille à renvoyer */ - - switch (symbol->type) - { - case STP_OBJECT: - result = 1; /* FIXME */ - break; - case STP_FUNCTION: - /* FIXME */if (symbol->extra.routine == NULL) result = 1; else - result = g_binary_routine_get_size(symbol->extra.routine); - break; - case STP_STRING: - result = strlen(g_binary_symbol_to_string(symbol)); - break; - } - - return result;; - -} - - -/****************************************************************************** -* * -* Paramètres : symbol = symbole à venir consulter. * * alt = désignation humaine alternative à favoriser. * * * * Description : Définit un autre nom pour le symbole. * |