summaryrefslogtreecommitdiffstats
path: root/libdwarf/libdwarf_sections.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdwarf/libdwarf_sections.c')
-rw-r--r--libdwarf/libdwarf_sections.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/libdwarf/libdwarf_sections.c b/libdwarf/libdwarf_sections.c
index 3ac30b2..24d5db8 100644
--- a/libdwarf/libdwarf_sections.c
+++ b/libdwarf/libdwarf_sections.c
@@ -26,7 +26,7 @@
#include "_libdwarf.h"
-ELFTC_VCSID("$Id: libdwarf_sections.c 2379 2012-01-05 02:08:20Z jkoshy $");
+ELFTC_VCSID("$Id: libdwarf_sections.c 3041 2014-05-18 15:11:03Z kaiwang27 $");
#define _SECTION_INIT_SIZE 128
@@ -212,7 +212,7 @@ _dwarf_find_section(Dwarf_Debug dbg, const char *name)
Dwarf_Section *ds;
Dwarf_Half i;
- assert(name != NULL);
+ assert(dbg != NULL && name != NULL);
for (i = 0; i < dbg->dbg_seccnt; i++) {
ds = &dbg->dbg_section[i];
@@ -223,6 +223,27 @@ _dwarf_find_section(Dwarf_Debug dbg, const char *name)
return (NULL);
}
+Dwarf_Section *
+_dwarf_find_next_types_section(Dwarf_Debug dbg, Dwarf_Section *ds)
+{
+
+ assert(dbg != NULL);
+
+ if (ds == NULL)
+ return (_dwarf_find_section(dbg, ".debug_types"));
+
+ assert(ds->ds_name != NULL);
+
+ do {
+ ds++;
+ if (ds->ds_name != NULL &&
+ !strcmp(ds->ds_name, ".debug_types"))
+ return (ds);
+ } while (ds->ds_name != NULL);
+
+ return (NULL);
+}
+
Dwarf_P_Section
_dwarf_pro_find_section(Dwarf_P_Debug dbg, const char *name)
{
OpenPOWER on IntegriCloud