summaryrefslogtreecommitdiff
path: root/src/arch/raw.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-09-17 21:36:49 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-09-17 21:36:49 (GMT)
commit65768127dea4c2760fe07cf843da7b4ad9e67da5 (patch)
treed0023eb7f378a4118fd074f3f61d5eae02e0882b /src/arch/raw.c
parentaf083f8bd6da340214ae392451dde5782fb79039 (diff)
Introduced memory ranges.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@406 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/raw.c')
-rw-r--r--src/arch/raw.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/arch/raw.c b/src/arch/raw.c
index 842c2b4..e127f91 100644
--- a/src/arch/raw.c
+++ b/src/arch/raw.c
@@ -187,16 +187,17 @@ static void g_raw_instruction_finalize(GRawInstruction *instr)
GArchInstruction *g_raw_instruction_new_array(const bin_t *data, MemoryDataSize size, size_t count, vmpa2t *addr, off_t end, SourceEndian endian)
{
GArchInstruction *result; /* Instruction à retourner */
- vmpa2t *old; /* Sauvegarde de la position */
+ vmpa2t old; /* Sauvegarde de la position */
size_t i; /* Boucle de parcours */
GArchOperand *operand; /* Octet non décodé à afficher */
+ mrange_t range; /* Couverture de l'instruction */
/* Par soucis de cohérence */
if (count == 0) return NULL;
result = g_object_new(G_TYPE_RAW_INSTRUCTION, NULL);
- old = dup_vmpa(addr);
+ copy_vmpa(&old, addr);
for (i = 0; i < count; i++)
{
@@ -208,9 +209,9 @@ GArchInstruction *g_raw_instruction_new_array(const bin_t *data, MemoryDataSize
g_arch_instruction_attach_extra_operand(result, operand);
}
- g_arch_instruction_set_location(result, old, compute_vmpa_diff(addr, old));
+ init_mrange(&range, &old, compute_vmpa_diff(addr, &old));
- delete_vmpa(old);
+ g_arch_instruction_set_range(result, &range);
return result;
@@ -251,7 +252,7 @@ static GBufferLine *g_raw_instruction_print(const GRawInstruction *instr, GCodeB
else
{
- result = g_code_buffer_append_new_line(buffer, &base->address2);
+ result = g_code_buffer_append_new_line(buffer, &base->range);
g_buffer_line_fill_for_instr(result, msize/* TODO ! */, msize, content, base->length, true);