summaryrefslogtreecommitdiff
path: root/src/format
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-05-06 00:07:18 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-05-06 00:07:18 (GMT)
commitd76e89e102aacfe945b44eb3150cb9f4bbf7b613 (patch)
tree7dda55fabeddcd0dbd1813d9ceef4b905a056c7f /src/format
parent2c6e4f3f3f15d1568e9dae407e32a217d8f7ab19 (diff)
Displayed a tooltip for strings or code symbols in buffer views.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@530 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format')
-rw-r--r--src/format/format.c46
-rw-r--r--src/format/format.h3
2 files changed, 49 insertions, 0 deletions
diff --git a/src/format/format.c b/src/format/format.c
index 2256160..c1877d2 100644
--- a/src/format/format.c
+++ b/src/format/format.c
@@ -482,6 +482,8 @@ bool g_binary_format_find_symbol_at(const GBinFormat *format, const vmpa2t *addr
result = false;
+ *symbol = NULL; /* TODO : vérifier les doublons côtés appelants */
+
for (i = 0; i < format->symbols_count && !result; i++)
{
range = g_binary_symbol_get_range(format->symbols[i]);
@@ -507,6 +509,50 @@ bool g_binary_format_find_symbol_at(const GBinFormat *format, const vmpa2t *addr
* Paramètres : format = informations chargées à consulter. *
* addr = adresse à cibler lors des recherches. *
* symbol = éventuel symbole trouvé à déréfenrencer. [OUT] *
+* *
+* Description : Recherche le symbole suivant celui lié à une adresse. *
+* *
+* Retour : true si l'opération a été un succès, false sinon. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+bool g_binary_format_find_next_symbol_at(const GBinFormat *format, const vmpa2t *addr, GBinSymbol **symbol)
+{
+ bool result; /* Bilan à retourner */
+ size_t i; /* Boucle de parcours */
+ const mrange_t *range; /* Espace mémoire parcouru */
+
+ result = false;
+
+ *symbol = NULL;
+
+ for (i = 0; i < format->symbols_count && !result; i++)
+ {
+ range = g_binary_symbol_get_range(format->symbols[i]);
+
+ if (cmp_vmpa(get_mrange_addr(range), addr) == 0 && (i + 1) < format->symbols_count)
+ {
+ *symbol = format->symbols[i + 1];
+ g_object_ref(G_OBJECT(*symbol));
+
+ result = true;
+
+ }
+
+ }
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : format = informations chargées à consulter. *
+* addr = adresse à cibler lors des recherches. *
+* symbol = éventuel symbole trouvé à déréfenrencer. [OUT] *
* diff = décallage entre l'adresse et le symbole. [OUT] *
* *
* Description : Recherche le symbole correspondant à une adresse. *
diff --git a/src/format/format.h b/src/format/format.h
index 66f014b..807e328 100644
--- a/src/format/format.h
+++ b/src/format/format.h
@@ -82,6 +82,9 @@ bool g_binary_format_find_symbol_by_label(const GBinFormat *, const char *, GBin
/* Recherche le symbole correspondant à une adresse. */
bool g_binary_format_find_symbol_at(const GBinFormat *, const vmpa2t *, GBinSymbol **);
+/* Recherche le symbole suivant celui lié à une adresse. */
+bool g_binary_format_find_next_symbol_at(const GBinFormat *, const vmpa2t *, GBinSymbol **);
+
/* Recherche le symbole correspondant à une adresse. */
bool g_binary_format_resolve_symbol(const GBinFormat *, const vmpa2t *, GBinSymbol **, phys_t *);