summaryrefslogtreecommitdiff
path: root/src/arch/instruction.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-08-25 21:03:25 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-08-25 21:03:25 (GMT)
commit90a79bf4c2c21715e5ef9d8a370928d218c08784 (patch)
tree57afefc5caa098f4c34ac2d382d085f736245990 /src/arch/instruction.c
parentdd51bdbc51abec252ad5169d722a8b6faa53c1ac (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/arch/instruction.c')
-rw-r--r--src/arch/instruction.c26
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);
}