summaryrefslogtreecommitdiff
path: root/plugins/dwarf/abbrev.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/dwarf/abbrev.h')
-rw-r--r--plugins/dwarf/abbrev.h126
1 files changed, 126 insertions, 0 deletions
diff --git a/plugins/dwarf/abbrev.h b/plugins/dwarf/abbrev.h
new file mode 100644
index 0000000..b5fe3be
--- /dev/null
+++ b/plugins/dwarf/abbrev.h
@@ -0,0 +1,126 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * abbrev.h - prototypes pour la manipulation des abréviation DWARF
+ *
+ * Copyright (C) 2008-2017 Cyrille Bagard
+ *
+ * This file is part of Chrysalide.
+ *
+ * Chrysalide is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Chrysalide is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Chrysalide. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _FORMAT_DWARF_ABBREV_H
+#define _FORMAT_DWARF_ABBREV_H
+
+
+#include <stdbool.h>
+
+
+#include "dwarf.h"
+#include "dwarf_def.h"
+
+
+
+
+/* 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 *);
+
+/* 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 *);
+
+
+/* Indique si une abbréviation comporte des sous-définitions. */
+bool dwarf_abbreviation_has_children(const dw_abbrev *);
+
+
+
+/* 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 *);
+
+
+
+
+
+
+
+
+
+
+
+
+
+#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 *);
+
+/* 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
+
+
+
+#endif /* _FORMAT_DWARF_ABBREV_H */