diff options
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é. * * * |