Module Name: src Committed By: christos Date: Sat Feb 20 02:39:47 UTC 2016
Modified Files: src/external/cddl/osnet/dist/tools/ctf/cvt: dwarf.c Log Message: - don't barf if the object does not have DWARF debug data. - bump size of types to 1K to avoid string overflow (both are needed for the new elftoolchain). To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c:1.15 src/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c:1.16 --- src/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c:1.15 Sun Dec 27 16:38:46 2015 +++ src/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c Fri Feb 19 21:39:47 2016 @@ -1325,7 +1325,7 @@ die_funcptr_create(dwarf_t *dw, Dwarf_Di static intr_t * die_base_name_parse(const char *name, char **newp) { - char buf[100]; + char buf[1024]; char const *base; char *c; int nlong = 0, nshort = 0, nchar = 0, nint = 0; @@ -2019,8 +2019,15 @@ dw_read(tdata_t *td, Elf *elf, char *fil } if ((rc = dwarf_next_cu_header_b(dw.dw_dw, &hdrlen, &vers, &abboff, - &addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) != DW_DLV_OK) + &addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) != DW_DLV_OK) { + if (dwarf_errno(dw.dw_err) == DW_DLE_NO_ENTRY) { + /* + * There's no DWARF section... + */ + return (0); + } terminate("rc = %d %s\n", rc, dwarf_errmsg(dw.dw_err)); + } if ((cu = die_sibling(&dw, NULL)) == NULL) goto out;