diff options
Diffstat (limited to 'src/arch/instruction.c')
-rw-r--r-- | src/arch/instruction.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/arch/instruction.c b/src/arch/instruction.c index e1ee023..ea713cd 100644 --- a/src/arch/instruction.c +++ b/src/arch/instruction.c @@ -51,7 +51,7 @@ static void g_arch_instruction_finalize(GArchInstruction *); /* Ajoute à un tampon GLib le contenu de l'instance spécifiée. */ -static void _g_arch_instruction_print(const GArchInstruction *, GCodeBuffer *, MemoryDataSize, const bin_t *, AsmSyntax); +static GBufferLine *_g_arch_instruction_print(const GArchInstruction *, GCodeBuffer *, MemoryDataSize, const bin_t *, AsmSyntax); @@ -692,39 +692,41 @@ const char *g_arch_instruction_get_keyword(const GArchInstruction *instr, AsmSyn * * ******************************************************************************/ -static void _g_arch_instruction_print(const GArchInstruction *instr, GCodeBuffer *buffer, MemoryDataSize msize, const bin_t *content, AsmSyntax syntax) +static GBufferLine *_g_arch_instruction_print(const GArchInstruction *instr, GCodeBuffer *buffer, MemoryDataSize msize, const bin_t *content, AsmSyntax syntax) { - GBufferLine *line; /* Ligne de destination */ + GBufferLine *result; /* Ligne de destination */ const char *key; /* Mot clef principal */ size_t klen; /* Taille de ce mot clef */ size_t i; /* Boucle de parcours */ - line = g_code_buffer_append_new_line(buffer, &instr->address2); + result = g_code_buffer_append_new_line(buffer, &instr->address2); - g_buffer_line_fill_for_instr(line, msize/* TODO ! */, msize, content, instr->length, true); + g_buffer_line_fill_for_instr(result, msize/* TODO ! */, msize, content, instr->length, true); /* Instruction proprement dite */ key = g_arch_instruction_get_keyword(instr, syntax); klen = strlen(key); - g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, key, klen, RTT_INSTRUCTION); + g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, key, klen, RTT_INSTRUCTION); if (instr->operands_count > 0) { - g_arch_operand_print(instr->operands[0], line, syntax); + g_arch_operand_print(instr->operands[0], result, syntax); for (i = 1; i < instr->operands_count; i++) { - g_buffer_line_insert_text(line, BLC_ASSEMBLY, ",", 1, RTT_PUNCT); - g_buffer_line_insert_text(line, BLC_ASSEMBLY, " ", 1, RTT_RAW); + g_buffer_line_insert_text(result, BLC_ASSEMBLY, ",", 1, RTT_PUNCT); + g_buffer_line_insert_text(result, BLC_ASSEMBLY, " ", 1, RTT_RAW); - g_arch_operand_print(instr->operands[i], line, syntax); + g_arch_operand_print(instr->operands[i], result, syntax); } } + return result; + } @@ -742,9 +744,9 @@ static void _g_arch_instruction_print(const GArchInstruction *instr, GCodeBuffer * * ******************************************************************************/ -void g_arch_instruction_print(const GArchInstruction *instr, GCodeBuffer *buffer, MemoryDataSize msize, const bin_t *content, AsmSyntax syntax) +GBufferLine *g_arch_instruction_print(const GArchInstruction *instr, GCodeBuffer *buffer, MemoryDataSize msize, const bin_t *content, AsmSyntax syntax) { - G_ARCH_INSTRUCTION_GET_CLASS(instr)->print(instr, buffer, msize, content, syntax); + return G_ARCH_INSTRUCTION_GET_CLASS(instr)->print(instr, buffer, msize, content, syntax); } |