summaryrefslogtreecommitdiff
path: root/src/arch/instruction.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-07-24 18:43:55 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-07-24 18:43:55 (GMT)
commit156d2e2f6beda2302552ac79678494d914fda05b (patch)
tree021825960b7ac3315a336fc085a4f1d07c05df39 /src/arch/instruction.c
parent21537636cd8318cf5a720211619ad3c3023b52e9 (diff)
Replaced all remaining raw accesses to binary contents with the GBinContent wrapper in binary formats.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@555 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/instruction.c')
-rw-r--r--src/arch/instruction.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/arch/instruction.c b/src/arch/instruction.c
index d6bf183..d9d7693 100644
--- a/src/arch/instruction.c
+++ b/src/arch/instruction.c
@@ -52,7 +52,7 @@ static void g_arch_instruction_finalize(GArchInstruction *);
/* Ajoute à un tampon GLib le contenu de l'instance spécifiée. */
-static GBufferLine *_g_arch_instruction_print(const GArchInstruction *, GCodeBuffer *, MemoryDataSize, const bin_t *, AsmSyntax);
+static GBufferLine *_g_arch_instruction_print(const GArchInstruction *, GCodeBuffer *, MemoryDataSize, const GBinContent *, AsmSyntax);
@@ -317,7 +317,7 @@ 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 (length != NULL) *length = instr->length;
+ //if (length != NULL) *length = instr->length;
if (address != NULL) *address = instr->address;
@@ -833,10 +833,11 @@ const char *g_arch_instruction_get_keyword(const GArchInstruction *instr, AsmSyn
/******************************************************************************
* *
-* Paramètres : instr = instruction d'assemblage à représenter. *
-* buffer = espace où placer ledit contenu. *
-* msize = taille idéale des positions et adresses; *
-* syntax = type de représentation demandée. *
+* Paramètres : instr = instruction d'assemblage à représenter. *
+* buffer = espace où placer ledit contenu. *
+* msize = taille idéale des positions et adresses; *
+* content = contenu binaire global à venir lire. *
+* syntax = type de représentation demandée. *
* *
* Description : Ajoute à un tampon GLib le contenu de l'instance spécifiée. *
* *
@@ -846,7 +847,7 @@ const char *g_arch_instruction_get_keyword(const GArchInstruction *instr, AsmSyn
* *
******************************************************************************/
-static GBufferLine *_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 GBinContent *content, AsmSyntax syntax)
{
GBufferLine *result; /* Ligne de destination */
const char *key; /* Mot clef principal */
@@ -857,8 +858,7 @@ static GBufferLine *_g_arch_instruction_print(const GArchInstruction *instr, GCo
g_buffer_line_add_flag(result, BLF_HAS_CODE);
- g_buffer_line_fill_for_instr(result, msize/* TODO ! */, msize,
- content, get_mrange_length(&instr->range), true);
+ g_buffer_line_fill_for_instr(result, msize/* TODO ! */, msize, content, true);
/* Instruction proprement dite */
@@ -892,6 +892,7 @@ static GBufferLine *_g_arch_instruction_print(const GArchInstruction *instr, GCo
* Paramètres : instr = instruction d'assemblage à représenter. *
* buffer = espace où placer ledit contenu. *
* msize = taille idéale des positions et adresses; *
+* content = contenu binaire global à venir lire. *
* syntax = type de représentation demandée. *
* *
* Description : Ajoute à un tampon GLib le contenu de l'instance spécifiée. *
@@ -902,7 +903,7 @@ static GBufferLine *_g_arch_instruction_print(const GArchInstruction *instr, GCo
* *
******************************************************************************/
-GBufferLine *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 GBinContent *content, AsmSyntax syntax)
{
return G_ARCH_INSTRUCTION_GET_CLASS(instr)->print(instr, buffer, msize, content, syntax);