diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-10-28 20:20:41 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-10-28 20:20:41 (GMT) |
commit | 2c70e3332b43bdcbe215081b697395d254418e48 (patch) | |
tree | d3287462eccd65d189f82de8428692bbaf477cbc /src/arch/instruction.c | |
parent | 0f0cb560006c0ef5eb690f89c4ce720936c9d6f6 (diff) |
Cleaned the structure for instructions a little bit.
Diffstat (limited to 'src/arch/instruction.c')
-rw-r--r-- | src/arch/instruction.c | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/src/arch/instruction.c b/src/arch/instruction.c index 4c0fdb9..fa631ac 100644 --- a/src/arch/instruction.c +++ b/src/arch/instruction.c @@ -372,10 +372,10 @@ const mrange_t *g_arch_instruction_get_range(const GArchInstruction *instr) void g_arch_instruction_get_location(const GArchInstruction *instr, off_t *offset, off_t *length, vmpa_t *address) { - if (offset != NULL) *offset = instr->offset; + //if (offset != NULL) *offset = instr->offset; //if (length != NULL) *length = instr->length; - if (address != NULL) *address = instr->address; + //if (address != NULL) *address = instr->address; } @@ -529,6 +529,8 @@ void g_arch_instruction_detach_operand(GArchInstruction *instr, GArchOperand *op void g_arch_instruction_get_rw_registers(const GArchInstruction *instr, GArchRegister ***rregs, size_t *rcount, GArchRegister ***wregs, size_t *wcount) { +#if 0 + size_t i; /* Boucle de parcours */ *rregs = NULL; @@ -544,6 +546,8 @@ void g_arch_instruction_get_rw_registers(const GArchInstruction *instr, GArchReg for (i = 0; i < *wcount; i++) g_object_ref(G_OBJECT((*wregs)[i])); +#endif + } @@ -568,10 +572,9 @@ void g_arch_instruction_get_rw_registers(const GArchInstruction *instr, GArchReg * * ******************************************************************************/ -void g_arch_instruction_link_with(GArchInstruction *instr, GArchInstruction *dest, InstructionLinkType type, ...) +void g_arch_instruction_link_with(GArchInstruction *instr, GArchInstruction *dest, InstructionLinkType type) { size_t count; /* Raccourci pour la lecture */ - va_list ap; /* Gestion des variations */ /* Côté destination */ @@ -599,25 +602,10 @@ void g_arch_instruction_link_with(GArchInstruction *instr, GArchInstruction *des count * sizeof(GArchInstruction *)); instr->to_types = (InstructionLinkType *)realloc(instr->to_types, count * sizeof(InstructionLinkType)); - instr->links_info = (link_extra_info *)realloc(instr->links_info, - count * sizeof(link_extra_info)); instr->to[count - 1] = dest; instr->to_types[count - 1] = type; - va_start(ap, type); - - switch (type) - { - case ILT_CASE_JUMP: - instr->links_info[count - 1].imm = va_arg(ap, GImmOperand *); - break; - default: - break; - } - - va_end(ap); - g_arch_instruction_wunlock_dest(instr); } @@ -854,7 +842,6 @@ bool g_arch_instruction_has_destinations(const GArchInstruction *instr) * Paramètres : instr = instruction dont les informations sont à consulter. * * dests = liste des instructions de destination. [OUT] * * types = liste des types de liens présents. [OUT] * -* info = éventuelles informations complémentaires. [OUT] * * * * Description : Fournit les destinations d'une instruction donnée. * * * @@ -864,7 +851,7 @@ bool g_arch_instruction_has_destinations(const GArchInstruction *instr) * * ******************************************************************************/ -size_t g_arch_instruction_get_destinations(const GArchInstruction *instr, GArchInstruction ***dests, InstructionLinkType **types, link_extra_info **info) +size_t g_arch_instruction_get_destinations(const GArchInstruction *instr, GArchInstruction ***dests, InstructionLinkType **types) { assert(g_atomic_int_get(&instr->hold_to_access) > 0); @@ -874,9 +861,6 @@ size_t g_arch_instruction_get_destinations(const GArchInstruction *instr, GArchI if (types != NULL) *types = instr->to_types; - if (info != NULL) - *info = instr->links_info; - return instr->to_count; } @@ -1114,6 +1098,8 @@ GBufferLine *g_arch_instruction_print(const GArchInstruction *instr, GCodeBuffer GDecInstruction *g_arch_instruction_decompile(const GArchInstruction *instr, GDecContext *ctx) { +#if 0 + GDecInstruction *result; /* Instruction à retourner */ GDecInstruction *list; /* Instructions décompilées */ @@ -1139,6 +1125,10 @@ GDecInstruction *g_arch_instruction_decompile(const GArchInstruction *instr, GDe return result; +#endif + + return NULL; + } |