diff options
Diffstat (limited to 'src/arch')
| -rw-r--r-- | src/arch/instruction.c | 2 | ||||
| -rw-r--r-- | src/arch/vmpa.c | 41 | ||||
| -rw-r--r-- | src/arch/vmpa.h | 19 | 
3 files changed, 62 insertions, 0 deletions
diff --git a/src/arch/instruction.c b/src/arch/instruction.c index 67fd184..c9811cf 100644 --- a/src/arch/instruction.c +++ b/src/arch/instruction.c @@ -792,6 +792,8 @@ static GBufferLine *_g_arch_instruction_print(const GArchInstruction *instr, GCo      result = g_code_buffer_append_new_line(buffer, &instr->range); +    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); diff --git a/src/arch/vmpa.c b/src/arch/vmpa.c index c479319..67be9a9 100644 --- a/src/arch/vmpa.c +++ b/src/arch/vmpa.c @@ -641,6 +641,47 @@ bool prepare_vmpa_db_statement(const vmpa2t *addr, bool create, bound_value **va  /* ---------------------------------------------------------------------------------- */ +/*                          AIDES FONCTIONNELLES AUXILIAIRES                          */ +/* ---------------------------------------------------------------------------------- */ + + +/****************************************************************************** +*                                                                             * +*  Paramètres  : label  = désignation humaine d'unn symbole de base.          * +*                offset = décalage déterminé à faie apparaître au besoin.     * +*                                                                             * +*  Description : Construit une désignation de symbole avec décalage.          * +*                                                                             * +*  Retour      : Chaîne de caractères constituée à libérer après usage.       * +*                                                                             * +*  Remarques   : -                                                            * +*                                                                             * +******************************************************************************/ + +char *make_symbol_offset(const char *label, phys_t offset) +{ +    char *result;                           /* Construction à retourner    */ +    size_t length;                          /* Taille de désignation créée */ + +    if (offset == 0) +        result = strdup(label); + +    else +    { +        length = strlen(label) + 1 + VMPA_MAX_LEN + 1; +        result = (char *)calloc(length, sizeof(char)); + +        snprintf(result, length, "%s+0x%llx", label, (unsigned long long)offset); + +    } + +    return result; + +} + + + +/* ---------------------------------------------------------------------------------- */  /*                          DEFINITION D'UNE ZONE EN MEMOIRE                          */  /* ---------------------------------------------------------------------------------- */ diff --git a/src/arch/vmpa.h b/src/arch/vmpa.h index ec356c8..675d5cb 100644 --- a/src/arch/vmpa.h +++ b/src/arch/vmpa.h @@ -52,6 +52,17 @@  #define phys_t off_t  #define virt_t uint64_t +/* Equivalents pour GLib */ +#define G_TYPE_PHYS uint64_t +#define G_TYPE_VIRT uint64_t +#define G_TYPE_PHYS_T G_TYPE_UINT64 +#define G_TYPE_VIRT_T G_TYPE_UINT64 + + +#define PHYS_CAST(v) ((uint64_t)v) +#define VIRT_CAST(v) ((uint64_t)v) + +  #define VMPA_NO_PHYSICAL ((phys_t)-1)  #define VMPA_NO_VIRTUAL ((virt_t)-2) @@ -137,6 +148,14 @@ bool prepare_vmpa_db_statement(const vmpa2t *, bool, bound_value **, size_t *); +/* ------------------------ AIDES FONCTIONNELLES AUXILIAIRES ------------------------ */ + + +/* Construit une désignation de symbole avec décalage. */ +char *make_symbol_offset(const char *, phys_t); + + +  /* ------------------------ DEFINITION D'UNE ZONE EN MEMOIRE ------------------------ */  | 
