summaryrefslogtreecommitdiff
path: root/src/analysis/line_code.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/line_code.c')
-rw-r--r--src/analysis/line_code.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/analysis/line_code.c b/src/analysis/line_code.c
index 2dd5a7c..44bb59f 100644
--- a/src/analysis/line_code.c
+++ b/src/analysis/line_code.c
@@ -37,7 +37,7 @@ struct _GCodeLine
{
GRenderingLine parent; /* Instance parente */
- asm_instr *instr; /* Instruction représentée */
+ GArchInstruction *instr; /* Instruction représentée */
const disass_options *options; /* Options de représentation */
};
@@ -133,7 +133,7 @@ void g_code_line_get_binary_len(GCodeLine *line, off_t *blen)
{
off_t len; /* Taille propre à la ligne */
- get_asm_instr_offset_and_length(line->instr, NULL, &len);
+ g_arch_instruction_get_location(line->instr, NULL, &len, NULL);
*blen = MAX(*blen, len);
@@ -158,7 +158,8 @@ void g_code_line_refresh_markup(GCodeLine *line)
char *content; /* Contenu réellement imprimé */
off_t bin_offset; /* Début de l'instruction */
off_t bin_len; /* Taille d'instruction */
- char buffer[CODE_BUFFER_LEN]; /* Zone tampon à utiliser */
+ char buffer[CODE_BUFFER_LEN]; /* Zone tampon à utiliser #1 */
+ char *buffer2; /* Zone tampon à utiliser #2 */
const uint8_t *exe_content; /* Contenu binaire global */
char *bin_code; /* Tampon du code binaire */
off_t k; /* Boucle de parcours #2 */
@@ -169,7 +170,7 @@ void g_code_line_refresh_markup(GCodeLine *line)
strcpy(content, "<tt>");
if (line->options->show_code)
- get_asm_instr_offset_and_length(line->instr, &bin_offset, &bin_len);
+ g_arch_instruction_get_location(line->instr, &bin_offset, &bin_len, NULL);
/* Eventuelle adresse virtuelle */
@@ -230,15 +231,16 @@ void g_code_line_refresh_markup(GCodeLine *line)
/* Instruction proprement dite */
- print_hinstruction(line->options->proc, line->options->format,
- line->instr, buffer, CODE_BUFFER_LEN, ASX_INTEL/*FIXME*/);
+ buffer2 = g_arch_instruction_get_text(line->instr, line->options->format, ASX_INTEL/*FIXME*/);
if (line->options->show_address || line->options->show_code) len += strlen("\t");
- len += strlen(buffer);
+ len += strlen(buffer2);
content = (char *)realloc(content, len * sizeof(char));
if (line->options->show_address || line->options->show_code) strcat(content, "\t");
- strcat(content, buffer);
+ strcat(content, buffer2);
+
+ free(buffer2);
/* Finalisation */
@@ -267,7 +269,7 @@ void g_code_line_refresh_markup(GCodeLine *line)
* *
******************************************************************************/
-GRenderingLine *g_code_line_new(uint64_t offset, asm_instr *instr, const disass_options *options)
+GRenderingLine *g_code_line_new(uint64_t offset, GArchInstruction *instr, const disass_options *options)
{
GCodeLine *result; /* Structure à retourner */