diff options
| author | Cyrille Bagard <nocbos@gmail.com> | 2014-08-25 21:03:25 (GMT) | 
|---|---|---|
| committer | Cyrille Bagard <nocbos@gmail.com> | 2014-08-25 21:03:25 (GMT) | 
| commit | 90a79bf4c2c21715e5ef9d8a370928d218c08784 (patch) | |
| tree | 57afefc5caa098f4c34ac2d382d085f736245990 /src/format/symbol.c | |
| parent | dd51bdbc51abec252ad5169d722a8b6faa53c1ac (diff) | |
Loaded lots of ELF header information as symbols.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@393 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/symbol.c')
| -rw-r--r-- | src/format/symbol.c | 54 | 
1 files changed, 53 insertions, 1 deletions
| diff --git a/src/format/symbol.c b/src/format/symbol.c index b478dc7..f1183cb 100644 --- a/src/format/symbol.c +++ b/src/format/symbol.c @@ -47,6 +47,8 @@ struct _GBinSymbol      } extra; +    GDbComment *comment;                    /* Eventuel commentaire lié    */ +  };  /* Symbole d'exécutable (classe) */ @@ -203,14 +205,25 @@ const vmpa2t *g_binary_symbol_get_address2(const GBinSymbol *symbol)  {      const vmpa2t *result;                   /* Localisation à retourner    */ +    result = NULL; +      switch (symbol->type)      {          case STP_DATA:              result = g_arch_instruction_get_location2(symbol->extra.instr, NULL);              break; +    default: +        result = NULL; +        break; +      } + +    if (result == NULL) +        printf("got addr=%p for symbol=%p (data=%d)\n", result, symbol, symbol->type == STP_DATA); + +      return result;  } @@ -293,7 +306,7 @@ void g_binary_symbol_attach_routine(GBinSymbol *symbol, GBinRoutine *routine)  /******************************************************************************  *                                                                             * -*  Paramètres  : symbol = symbole à venir consulter.                          * +*  Paramètres  : symbol = symbole à venir manipuler.                          *  *                instr  = représentation du symbole associé.                  *  *                                                                             *  *  Description : Attache l'instruction associée au symbole.                   * @@ -330,3 +343,42 @@ GArchInstruction *g_binary_symbol_get_instruction(const GBinSymbol *symbol)      return symbol->extra.instr;  } + + +/****************************************************************************** +*                                                                             * +*  Paramètres  : symbol  = symbole à venir manipuler.                         * +*                comment = commentaire construit à propos du symbole.         * +*                                                                             * +*  Description : Ajoute un commentaire facultatif au symbole.                 * +*                                                                             * +*  Retour      : -                                                            * +*                                                                             * +*  Remarques   : -                                                            * +*                                                                             * +******************************************************************************/ + +void g_binary_symbol_set_comment(GBinSymbol *symbol, GDbComment *comment) +{ +    symbol->comment = comment; + +} + + +/****************************************************************************** +*                                                                             * +*  Paramètres  : symbol = symbole à venir consulter.                          * +*                                                                             * +*  Description : Fournit l'éventuel commentaire associé au symbole.           * +*                                                                             * +*  Retour      : -                                                            * +*                                                                             * +*  Remarques   : Il n'y a pas de transfert de propriété ici !                 * +*                                                                             * +******************************************************************************/ + +GDbComment *g_binary_symbol_get_comment(const GBinSymbol *symbol) +{ +    return symbol->comment; + +} | 
