summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-11-02 15:50:07 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-11-02 15:50:07 (GMT)
commitf5df6496fa50927d3d274c939a888afde652b7ad (patch)
tree281dbfdfdcb8765fea7036af274c63fb5acde8ff /src/analysis
parentc3aba0893c29cc098c029306fd7a4c8c1fa2eee2 (diff)
Improved the computing and the rendering of the graphic view.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@277 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis')
-rw-r--r--src/analysis/binary-int.h2
-rw-r--r--src/analysis/binary.c16
-rw-r--r--src/analysis/binary.h14
3 files changed, 23 insertions, 9 deletions
diff --git a/src/analysis/binary-int.h b/src/analysis/binary-int.h
index c9be0bf..f813aa8 100644
--- a/src/analysis/binary-int.h
+++ b/src/analysis/binary-int.h
@@ -63,7 +63,7 @@ struct _GLoadedBinary
size_t decbuf_count; /* Taille des tableaux */
size_t defsrc; /* Fichier source principal */
- bool text_display[2]; /* Position et code binaire #1 */
+ bool text_display[BDT_COUNT][2]; /* Position et code binaire #1 */
bool lines_display; /* Affichage des lignes */
};
diff --git a/src/analysis/binary.c b/src/analysis/binary.c
index d5bf029..b9292aa 100644
--- a/src/analysis/binary.c
+++ b/src/analysis/binary.c
@@ -122,8 +122,10 @@ static void g_loaded_binary_class_init(GLoadedBinaryClass *klass)
static void g_loaded_binary_init(GLoadedBinary *binary)
{
- binary->text_display[0] = true;
- binary->text_display[1] = true;
+ binary->text_display[BDT_ASM][0] = true;
+ binary->text_display[BDT_ASM][1] = true;
+ binary->text_display[BDT_GRAPH][0] = true;
+ binary->text_display[BDT_GRAPH][1] = false;
binary->lines_display = true;
@@ -681,6 +683,7 @@ GCodeBuffer *g_loaded_binary_get_disassembled_buffer(const GLoadedBinary *binary
/******************************************************************************
* *
* Paramètres : binary = élément binaire à consulter. *
+* type = type de représentation visée. *
* *
* Description : Indique si les adresses doivent apparaître dans le rendu. *
* *
@@ -690,9 +693,9 @@ GCodeBuffer *g_loaded_binary_get_disassembled_buffer(const GLoadedBinary *binary
* *
******************************************************************************/
-bool *g_loaded_binary_display_addresses_in_text(GLoadedBinary *binary)
+bool *g_loaded_binary_display_addresses_in_text(GLoadedBinary *binary, BinaryDisplayType type)
{
- return &binary->text_display[0];
+ return &binary->text_display[type][0];
}
@@ -700,6 +703,7 @@ bool *g_loaded_binary_display_addresses_in_text(GLoadedBinary *binary)
/******************************************************************************
* *
* Paramètres : binary = élément binaire à consulter. *
+* type = type de représentation visée. *
* *
* Description : Indique si le code doit apparaître dans le rendu. *
* *
@@ -709,9 +713,9 @@ bool *g_loaded_binary_display_addresses_in_text(GLoadedBinary *binary)
* *
******************************************************************************/
-bool *g_loaded_binary_display_code_in_text(GLoadedBinary *binary)
+bool *g_loaded_binary_display_code_in_text(GLoadedBinary *binary, BinaryDisplayType type)
{
- return &binary->text_display[1];
+ return &binary->text_display[type][1];
}
diff --git a/src/analysis/binary.h b/src/analysis/binary.h
index 7ff9080..eb042c6 100644
--- a/src/analysis/binary.h
+++ b/src/analysis/binary.h
@@ -62,6 +62,16 @@ typedef enum _BinaryPartModel
} BinaryPartModel;
+/* Types de représentation */
+typedef enum _BinaryDisplayType
+{
+ BDT_ASM, /* Rendu du code brut */
+ BDT_GRAPH, /* Rendu avec graphiques */
+
+ BDT_COUNT
+
+} BinaryDisplayType;
+
/* Indique le type défini pour une description de fichier binaire. */
GType g_loaded_binary_get_type(void);
@@ -97,10 +107,10 @@ GArchInstruction *g_loaded_binary_get_instructions(const GLoadedBinary *);
GCodeBuffer *g_loaded_binary_get_disassembled_buffer(const GLoadedBinary *);
/* Indique si les adresses doivent apparaître dans le rendu. */
-bool *g_loaded_binary_display_addresses_in_text(GLoadedBinary *);
+bool *g_loaded_binary_display_addresses_in_text(GLoadedBinary *, BinaryDisplayType);
/* Indique si le code doit apparaître dans le rendu. */
-bool *g_loaded_binary_display_code_in_text(GLoadedBinary *);
+bool *g_loaded_binary_display_code_in_text(GLoadedBinary *, BinaryDisplayType);
/* Fournit le tampon associé au contenu d'un fichier source. */
GCodeBuffer *g_loaded_binary_get_decompiled_buffer(const GLoadedBinary *, size_t);