summaryrefslogtreecommitdiff
path: root/plugins/dwarf/abbrev.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-11-24 14:28:22 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-11-24 14:28:22 (GMT)
commitdd851e1fb743d77b421519ee5915534aed2d2c4f (patch)
tree9a9f91c09438467ade7a67c5e2188b4051d23569 /plugins/dwarf/abbrev.h
parent59b1bdfdc9b64dac8fd1450c51aa5014c8c469f0 (diff)
Updated the DWARF support.
Diffstat (limited to 'plugins/dwarf/abbrev.h')
-rw-r--r--plugins/dwarf/abbrev.h97
1 files changed, 28 insertions, 69 deletions
diff --git a/plugins/dwarf/abbrev.h b/plugins/dwarf/abbrev.h
index b5fe3be..6536b72 100644
--- a/plugins/dwarf/abbrev.h
+++ b/plugins/dwarf/abbrev.h
@@ -2,7 +2,7 @@
/* Chrysalide - Outil d'analyse de fichiers binaires
* abbrev.h - prototypes pour la manipulation des abréviation DWARF
*
- * Copyright (C) 2008-2017 Cyrille Bagard
+ * Copyright (C) 2008-2018 Cyrille Bagard
*
* This file is part of Chrysalide.
*
@@ -21,106 +21,65 @@
*/
-#ifndef _FORMAT_DWARF_ABBREV_H
-#define _FORMAT_DWARF_ABBREV_H
+#ifndef _PLUGINS_DWARF_ABBREV_H
+#define _PLUGINS_DWARF_ABBREV_H
#include <stdbool.h>
-#include "dwarf.h"
-#include "dwarf_def.h"
+#include "form.h"
+#include "format.h"
+/* ----------------------- TRAITEMENT D'ABREVIATION A L'UNITE ----------------------- */
-/* Description d'une abréviation */
-typedef struct _dw_abbrev dw_abbrev;
-
-
-
-
-
-
-
-/* Charge toutes les abbréviations présentes dans un DWARF. */
-bool load_all_dwarf_abbreviations(GDwarfFormat *);
-/* Charge une abréviation valide pour un DWARF en mémoire. */
-bool load_dwarf_abbreviation(const GDwarfFormat *, vmpa2t *, dw_abbrev **);
-
-/* Supprime de la mémoire toute trace d'une abréviation DWARF. */
-void free_dwarf_abbreviation(dw_abbrev *);
+/* Description d'une abréviation */
+typedef struct _dw_abbrev dw_abbrev;
-/* Fournit l'étiquette associée à l'ensemble des attributs. */
-DwarfTag dwarf_abbreviation_get_tag(const dw_abbrev *);
/* Compte le nombre d'attributs présents dans une abréviation. */
size_t dwarf_abbreviation_count_attribs(const dw_abbrev *);
-/* Recherche un attribut dans une abréviation. */
-bool dwarf_abbreviation_get_attrib_index(const dw_abbrev *, DwarfAttrib, size_t *);
-
-
-/* Détermine le type d'un attribut dans une abréviation. */
-bool dwarf_abbreviation_get_form_for_index(const dw_abbrev *, size_t, DwarfForm *);
+/* Forme de valeur typée */
+typedef struct _dw_value
+{
+ DwarfAttrib attrib; /* Sujet de l'élément */
+ dw_form_value *value; /* Valeur instanciée associée */
-/* Indique si une abbréviation comporte des sous-définitions. */
-bool dwarf_abbreviation_has_children(const dw_abbrev *);
+} dw_value;
-
-/* Recherche une abréviation DWARF donnée. */
-const dw_abbrev *find_dwarf_abbreviations(const GDwarfFormat *, uleb128_t);
-
/* Lit la valeur correspondant à un type donné. */
-dw_value *translate_abbreviation_attributes(const GDwarfFormat *, const dw_abbrev *, const dw_compil_unit_header *, vmpa2t *);
-
+dw_value *translate_abbrev_attribs(const dw_abbrev *, const GDwarfFormat *, GBinContent *, vmpa2t *, const dw_compil_unit_header *);
+/* Supprime de la mémoire une liste de valeurs typées. */
+void free_abbrev_attribs(dw_value *, size_t);
+/* Détermine si l'abréviation possède des enfants. */
+bool has_abbrev_children(const dw_abbrev *);
+/* ----------------------- TRAITEMENT D'ABREVIATIONS PAR LOTS ----------------------- */
+/* Brochette d'abréviations */
+typedef struct _dw_abbrev_brotherhood dw_abbrev_brotherhood;
+/* Charge une série d'abréviations présentes dans un DWARF. */
+dw_abbrev_brotherhood *load_all_dwarf_abbreviations(GDwarfFormat *, const dw_compil_unit_header *);
-
-
-#if 0
-
-
-#include <stdbool.h>
-
-
-#include "d_dwarf.h"
-#include "dwarf-int.h"
-
-
-
-/* Charge les abréviations trouvées pour un DWARF. */
-bool load_dwarf_abbreviations(dwarf_format *);
-
-/* Décharge les abréviations trouvées pour un DWARF. */
-void unload_dwarf_abbreviations(dwarf_format *);
+/* Supprime de la mémoire toute trace d'abréviations DWARF. */
+void free_all_dwarf_abbreviations(dw_abbrev_brotherhood *);
/* Recherche une abréviation DWARF donnée. */
-const dw_abbrev *find_dwarf_abbreviations(dwarf_format *, const off_t *, off_t *);
-
-/* Indique la présence ou l'absence d'un attribut donné. */
-bool test_dwarf_abbrev_attribute(const dw_abbrev *, DwarfAttrib);
-
-/* Lit la valeur d'un attribut DWARF. */
-bool read_dwarf_abbrev_attribute(dwarf_format *, off_t *, bool, const dw_abbrev *, DwarfAttrib, ...);
-
-/* Fait avancer la tête de lecture d'une seule abréviation. */
-bool skip_dwarf_abbrev(dwarf_format *, off_t *, const dw_abbrev *);
-
-
-#endif
+const dw_abbrev *find_dwarf_abbreviation(const dw_abbrev_brotherhood *, uleb128_t);
-#endif /* _FORMAT_DWARF_ABBREV_H */
+#endif /* _PLUGINS_DWARF_ABBREV_H */