diff options
author | Ed Maste <emaste@FreeBSD.org> | 2014-12-22 20:32:23 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2014-12-22 20:32:23 +0000 |
commit | 5eccfb5cf5403e9e564066e0a75d80534b49e91d (patch) | |
tree | 78347950207dea134308b7c9d4843204e80507e0 /libdwarf/libdwarf_sections.c | |
parent | 5265ace0e440a23fb522c516f4ee20f43eaed2b3 (diff) |
Notes
Diffstat (limited to 'libdwarf/libdwarf_sections.c')
-rw-r--r-- | libdwarf/libdwarf_sections.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/libdwarf/libdwarf_sections.c b/libdwarf/libdwarf_sections.c index 3ac30b251e02..24d5db839e49 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) { |