summaryrefslogtreecommitdiff
path: root/src/format/symbol.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/format/symbol.c')
-rw-r--r--src/format/symbol.c64
1 files changed, 62 insertions, 2 deletions
diff --git a/src/format/symbol.c b/src/format/symbol.c
index 467bfd2..b478dc7 100644
--- a/src/format/symbol.c
+++ b/src/format/symbol.c
@@ -42,6 +42,7 @@ struct _GBinSymbol
union
{
+ GArchInstruction *instr; /* Instruction correspondante */
GBinRoutine *routine; /* Compléments pour fonction */
} extra;
@@ -178,6 +179,14 @@ const char *g_binary_symbol_to_string(const GBinSymbol *symbol)
}
+vmpa_t g_binary_symbol_get_address(const GBinSymbol *symbol)
+{
+
+ return 0;
+
+}
+
+
/******************************************************************************
* *
* Paramètres : symbol = symbole à venir consulter. *
@@ -190,9 +199,19 @@ const char *g_binary_symbol_to_string(const GBinSymbol *symbol)
* *
******************************************************************************/
-vmpa_t g_binary_symbol_get_address(const GBinSymbol *symbol)
+const vmpa2t *g_binary_symbol_get_address2(const GBinSymbol *symbol)
{
- return symbol->address;
+ const vmpa2t *result; /* Localisation à retourner */
+
+ switch (symbol->type)
+ {
+ case STP_DATA:
+ result = g_arch_instruction_get_location2(symbol->extra.instr, NULL);
+ break;
+
+ }
+
+ return result;
}
@@ -270,3 +289,44 @@ void g_binary_symbol_attach_routine(GBinSymbol *symbol, GBinRoutine *routine)
symbol->extra.routine = routine;
}
+
+
+/******************************************************************************
+* *
+* Paramètres : symbol = symbole à venir consulter. *
+* instr = représentation du symbole associé. *
+* *
+* Description : Attache l'instruction associée au symbole. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void g_binary_symbol_attach_instruction(GBinSymbol *symbol, GArchInstruction *instr)
+{
+ symbol->type = STP_DATA;
+
+ symbol->extra.instr = instr;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : symbol = symbole à venir consulter. *
+* *
+* Description : Fournit l'éventuelle instruction associée au symbole. *
+* *
+* Retour : - *
+* *
+* Remarques : Il n'y a pas de transfert de propriété ici ! *
+* *
+******************************************************************************/
+
+GArchInstruction *g_binary_symbol_get_instruction(const GBinSymbol *symbol)
+{
+ return symbol->extra.instr;
+
+}