summaryrefslogtreecommitdiff
path: root/src/arch/instruction.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/instruction.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/instruction.c')
-rw-r--r--src/arch/instruction.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/src/arch/instruction.c b/src/arch/instruction.c
index ea713cd..402b0f5 100644
--- a/src/arch/instruction.c
+++ b/src/arch/instruction.c
@@ -159,15 +159,9 @@ static void g_arch_instruction_finalize(GArchInstruction *instr)
* *
******************************************************************************/
-void g_arch_instruction_set_location(GArchInstruction *instr, const vmpa2t *address, off_t length)
+void g_arch_instruction_set_range(GArchInstruction *instr, const mrange_t *range)
{
- copy_vmpa(&instr->address2, address);
-
- /* FIXME */
- instr->offset = get_phy_addr(address);
- instr->address = get_virt_addr(address);
-
- instr->length = length;
+ copy_mrange(&instr->range, range);
}
@@ -175,23 +169,18 @@ void g_arch_instruction_set_location(GArchInstruction *instr, const vmpa2t *addr
/******************************************************************************
* *
* Paramètres : instr = instruction quelconque à consulter. *
-* offset = position physique dans le code binaire/NULL. [OUT] *
-* length = taille de l'instruction ou NULL. [OUT] *
-* address = adresse virtuelle ou position physique/NULL. [OUT] *
* *
-* Description : Fournit la localisation d'une instruction. *
+* Description : Fournit la place mémoire d'une instruction. *
* *
-* Retour : - *
+* Retour : Zone mémoire couverte par l'instruction. *
* *
* Remarques : - *
* *
******************************************************************************/
-const vmpa2t *g_arch_instruction_get_location2(const GArchInstruction *instr, off_t *length)
+const mrange_t *g_arch_instruction_get_range(const GArchInstruction *instr)
{
- if (length != NULL) *length = instr->length;
-
- return &instr->address2;
+ return &instr->range;
}
@@ -699,7 +688,7 @@ static GBufferLine *_g_arch_instruction_print(const GArchInstruction *instr, GCo
size_t klen; /* Taille de ce mot clef */
size_t i; /* Boucle de parcours */
- result = g_code_buffer_append_new_line(buffer, &instr->address2);
+ result = g_code_buffer_append_new_line(buffer, &instr->range);
g_buffer_line_fill_for_instr(result, msize/* TODO ! */, msize, content, instr->length, true);