diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-03-18 23:18:26 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-03-18 23:18:26 (GMT) |
commit | 4cef477cbdfd61a28ed6531d1e91d5a330a67704 (patch) | |
tree | 1b4708f624e0f3bdb26403ab06ac9689cf4cf583 /src/format/symbol.c | |
parent | 5c1636199a06965c549f748014d582dcb85ba7df (diff) |
Computed limits for all routines according to existing symbols.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@491 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/symbol.c')
-rw-r--r-- | src/format/symbol.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/format/symbol.c b/src/format/symbol.c index d360591..c867b68 100644 --- a/src/format/symbol.c +++ b/src/format/symbol.c @@ -228,6 +228,7 @@ const char *g_binary_symbol_to_string(const GBinSymbol *symbol) { case STP_ROUTINE: case STP_ENTRY_POINT: + case STP_CODE_LABEL: result = g_binary_routine_get_name(symbol->extra.routine); break; @@ -292,6 +293,7 @@ const char *g_binary_symbol_get_label(const GBinSymbol *symbol) { case STP_ROUTINE: case STP_ENTRY_POINT: + case STP_CODE_LABEL: result = g_binary_routine_get_name(symbol->extra.routine); break; @@ -344,6 +346,7 @@ void g_binary_symbol_fix_range(GBinSymbol *symbol, const vmpa2t *full) case STP_ROUTINE: case STP_ENTRY_POINT: + case STP_CODE_LABEL: routine = g_binary_symbol_get_routine(symbol); @@ -392,6 +395,7 @@ const mrange_t *g_binary_symbol_get_range(const GBinSymbol *symbol) case STP_ROUTINE: case STP_ENTRY_POINT: + case STP_CODE_LABEL: result = g_binary_routine_get_range(symbol->extra.routine); break; @@ -431,6 +435,7 @@ void g_binary_symbol_set_alt_name(GBinSymbol *symbol, char *alt) * * * Paramètres : symbol = symbole à venir consulter. * * routine = prototype de la fonction représentée. * +* type = (nouveau) type du symbole attaché. * * * * Description : Attache la routine associée au symbole. * * * @@ -440,8 +445,13 @@ void g_binary_symbol_set_alt_name(GBinSymbol *symbol, char *alt) * * ******************************************************************************/ -void g_binary_symbol_attach_routine(GBinSymbol *symbol, GBinRoutine *routine) +void _g_binary_symbol_attach_routine(GBinSymbol *symbol, GBinRoutine *routine, SymbolType type) { + if (symbol->extra.routine != NULL) + g_object_unref(G_OBJECT(symbol->extra.routine)); + + symbol->type = type; + symbol->extra.routine = routine; } @@ -449,6 +459,26 @@ void g_binary_symbol_attach_routine(GBinSymbol *symbol, GBinRoutine *routine) /****************************************************************************** * * +* Paramètres : symbol = symbole à venir consulter. * +* routine = prototype de la fonction représentée. * +* * +* Description : Attache la routine associée au symbole. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void g_binary_symbol_attach_routine(GBinSymbol *symbol, GBinRoutine *routine) +{ + _g_binary_symbol_attach_routine(symbol, routine, symbol->type); + +} + + +/****************************************************************************** +* * * Paramètres : symbol = symbole à venir manipuler. * * instr = représentation du symbole associé. * * * |