From 701b3b1a72d5b2697cbb37074e2a58580bcc1b4c Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Thu, 2 Mar 2017 15:37:02 +0100 Subject: Removed dead code. --- ChangeLog | 6 +++ src/glibext/gbufferline.c | 122 ---------------------------------------------- src/glibext/gbufferline.h | 6 --- 3 files changed, 6 insertions(+), 128 deletions(-) diff --git a/ChangeLog b/ChangeLog index e36de8b..f5fba2a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 17-03-02 Cyrille Bagard + * src/glibext/gbufferline.c: + * src/glibext/gbufferline.h: + Remove dead code. + +17-03-02 Cyrille Bagard + * src/analysis/disass/area.c: Set the global content for each collected instruction. diff --git a/src/glibext/gbufferline.c b/src/glibext/gbufferline.c index d9e974c..4eb56d9 100644 --- a/src/glibext/gbufferline.c +++ b/src/glibext/gbufferline.c @@ -488,128 +488,6 @@ void g_buffer_line_fill_content(GBufferLine *line, const GBinContent *content, c /****************************************************************************** * * -* Paramètres : line = ligne à venir compléter. * -* psize = taille souhaitée de l'impression des positions. * -* vsize = taille souhaitée de l'impression des adresses. * -* * -* Description : Construit le tronc commun d'une ligne autour de sa position. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -void g_buffer_line_fill_mrange(GBufferLine *line, MemoryDataSize psize, MemoryDataSize vsize) -{ - g_buffer_line_fill_vmpa(line, get_mrange_addr(&line->range), psize, vsize); - -} - - -/****************************************************************************** -* * -* Paramètres : line = ligne à venir compléter. * -* psize = taille souhaitée de l'impression des positions. * -* vsize = taille souhaitée de l'impression des adresses. * -* content = contenu binaire global à venir lire. * -* max = taille maximal de la portion binaire en octets. * -* * -* Description : Construit le tronc commun d'une ligne d'instruction. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -void g_buffer_line_fill_for_instr(GBufferLine *line, MemoryDataSize psize, MemoryDataSize vsize, const GBinContent *content, phys_t max) -{ - phys_t length; /* Taille de la couverture */ - bool truncated; /* Indique si le code est coupé*/ - size_t required; /* Taille de traitement requise*/ - char static_buffer[64]; /* Petit tampon local rapide */ - char *bin_code; /* Tampon utilisé pour le code */ - vmpa2t pos; /* Boucle de parcours #1 */ - phys_t i; /* Boucle de parcours #2 */ - char *iter; /* Boucle de parcours #3 */ - int ret; /* Progression dans l'écriture */ - uint8_t byte; /* Octet à représenter */ - - static const char *charset = "0123456789abcdef"; - - /* Adresse physique puis virtuelle */ - - g_buffer_line_fill_mrange(line, psize, vsize); - - /* Détermination du réceptacle */ - - length = get_mrange_length(&line->range); - - truncated = (max != VMPA_NO_PHYSICAL && length > max); - - if (truncated) - { - length = max; - required = length * 3 + 4 /* "..." */ + 1; - } - else - required = length * 3 + 1; - - if (required <= sizeof(static_buffer)) - bin_code = static_buffer; - else - bin_code = (char *)calloc(required, sizeof(char)); - - /* Code brut */ - - copy_vmpa(&pos, get_mrange_addr(&line->range)); - - for (i = 0, iter = bin_code; i < length; i++, iter += ret) - { - if (i == 0) - ret = 0; - else - { - iter[0] = ' '; - ret = 1; - } - - if (!g_binary_content_read_u8(content, &pos, &byte)) - { - iter[ret + 0] = '?'; - iter[ret + 1] = '?'; - } - else - { - iter[ret + 0] = charset[byte >> 4]; - iter[ret + 1] = charset[byte & 0x0f]; - } - - ret += 2; - - } - - if (truncated) - { - strcpy(iter, "..."); - iter += 3; - } - else - *iter = '\0'; - - /* Conclusion */ - - g_buffer_line_append_text(line, BLC_BINARY, bin_code, iter - bin_code, RTT_RAW_CODE, NULL); - - if (bin_code != static_buffer) - free(bin_code); - -} - - -/****************************************************************************** -* * * Paramètres : line = ligne à venir consulter. * * column = indice de la colonne visée par les recherches. * * * diff --git a/src/glibext/gbufferline.h b/src/glibext/gbufferline.h index 9478404..818d068 100644 --- a/src/glibext/gbufferline.h +++ b/src/glibext/gbufferline.h @@ -120,12 +120,6 @@ void g_buffer_line_fill_vmpa(GBufferLine *, const vmpa2t *, MemoryDataSize, Memo /* Construit le tronc commun d'une ligne autour de son contenu. */ void g_buffer_line_fill_content(GBufferLine *, const GBinContent *, const mrange_t *, phys_t); -/* Construit le tronc commun d'une ligne autour de sa position. */ -void g_buffer_line_fill_mrange(GBufferLine *, MemoryDataSize, MemoryDataSize); - -/* Construit le tronc commun d'une ligne d'instruction. */ -void g_buffer_line_fill_for_instr(GBufferLine *, MemoryDataSize, MemoryDataSize, const GBinContent *, phys_t); - /* Recherche le premier créateur enregistré dans des segments. */ GObject *g_buffer_line_find_first_segment_creator(const GBufferLine *, BufferLineColumn); -- cgit v0.11.2-87-g4458