summaryrefslogtreecommitdiff
path: root/src/format/dwarf/abbrev.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2008-08-24 12:44:56 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2008-08-24 12:44:56 (GMT)
commit7af746b641de4a8d6d99ceb2bfd7f77af824bbcf (patch)
tree0cc875d7ec3029667fdd540bc140b932e9a98497 /src/format/dwarf/abbrev.c
parentb17cecbb96055914ac3c085030ebd5ff0bc1d370 (diff)
Registered found debug functions and handled the void type.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@20 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/dwarf/abbrev.c')
-rw-r--r--src/format/dwarf/abbrev.c70
1 files changed, 47 insertions, 23 deletions
diff --git a/src/format/dwarf/abbrev.c b/src/format/dwarf/abbrev.c
index ba6cfb0..3cb2c4a 100644
--- a/src/format/dwarf/abbrev.c
+++ b/src/format/dwarf/abbrev.c
@@ -305,29 +305,6 @@ const dw_abbrev *_find_dwarf_abbreviations(const dw_abbrev *abbrev, uint8_t *ind
}
-const dw_abbrev *find_dwarf_abbreviations_old(dwarf_format *format, const off_t *offset, uint8_t index)
-{
- const dw_abbrev *result; /* Structure à retourner */
- size_t i; /* Boucle de parcours */
-
- if (index == 0) return NULL;
-
- result = NULL;
-
- for (i = 0; i < format->abbrevs_count; i++)
- if (format->abbrevs[i]->offset == *offset) break;
-
- if (i < format->abbrevs_count)
- {
- index--;
- result = _find_dwarf_abbreviations(format->abbrevs[i], &index);
- }
-
- return result;
-
-}
-
-
/******************************************************************************
* *
* Paramètres : format = informations de débogage à consulter. *
@@ -376,6 +353,34 @@ const dw_abbrev *find_dwarf_abbreviations(dwarf_format *format, const off_t *off
/******************************************************************************
* *
+* Paramètres : abbrev = informations à parcourir. *
+* attrib = attribut visé par la lecture. *
+* *
+* Description : Indique la présence ou l'absence d'un attribut donné. *
+* *
+* Retour : true si l'attribut est présent, false sinon. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+bool test_dwarf_abbrev_attribute(const dw_abbrev *abbrev, DwarfAttrib attrib)
+{
+ bool result; /* Bilan à retourner */
+ size_t i; /* Boucle de parcours */
+
+ result = false;
+
+ for (i = 0; i < abbrev->attribs_count && !result; i++)
+ result = (abbrev->attribs[i].attrib == attrib);
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : format = informations de débogage à compléter. *
* pos = tête de lecture à mettre à jour. [OUT] *
* form = format des données à lire. *
@@ -748,12 +753,31 @@ bool skip_dwarf_abbrev(dwarf_format *format, off_t *pos, const dw_abbrev *abbrev
{
bool result; /* Bilan à revoyer */
size_t i; /* Boucle de parcours */
+ uint64_t index; /* Code de padding */
result = true;
+ /* Ecartement du corps */
+
for (i = 0; i < abbrev->attribs_count && result; i++)
result = _read_dwarf_abbrev_attribute(format, pos, abbrev->attribs[i].form, NULL);
+ /* Ecartement du padding */
+
+ do
+ {
+ if (!read_uleb128(format, pos, &index, false))
+ {
+ printf("error skipping padding...\n");
+ return false;
+ }
+
+ if (index == 0)
+ read_uleb128(format, pos, &index, true);
+
+ }
+ while (index == 0);
+
return result;
}