diff options
author | Richard Lowe <richlowe@richlowe.net> | 2011-12-10 21:55:25 +0000 |
---|---|---|
committer | Richard Lowe <richlowe@richlowe.net> | 2011-12-10 21:55:25 +0000 |
commit | 5257890a8596a8d25bcd6b12eb9b9cf0888efd24 (patch) | |
tree | 09aa5deaaa37b09de8a587ba447e522bdd3ef1ed /usr/src/tools/ctf/cvt/dwarf.c | |
parent | a3fb080f8ee7268e007cd68c6df8b992a7bd0691 (diff) | |
download | illumos-joyent-5257890a8596a8d25bcd6b12eb9b9cf0888efd24.tar.gz |
1877 ctfconvert should give more detail on DWARF errors
Reviewed by: Jason King <jason.brian.king@gmail.com>
Reviewed by: Garrett D'Amore <garrett@nexenta.com>
Reviewed by: Dan McDonald <danmcd@nexenta.com>
Approved by: Eric Schrock <eric.schrock@delphix.com>
Diffstat (limited to 'usr/src/tools/ctf/cvt/dwarf.c')
-rw-r--r-- | usr/src/tools/ctf/cvt/dwarf.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr/src/tools/ctf/cvt/dwarf.c b/usr/src/tools/ctf/cvt/dwarf.c index a7e97dfb23..ce8f6f9601 100644 --- a/usr/src/tools/ctf/cvt/dwarf.c +++ b/usr/src/tools/ctf/cvt/dwarf.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * DWARF to tdata conversion * @@ -1832,8 +1830,11 @@ dw_read(tdata_t *td, Elf *elf, const char *filename) } if ((rc = dwarf_next_cu_header(dw.dw_dw, &hdrlen, &vers, &abboff, - &addrsz, &nxthdr, &dw.dw_err)) != DW_DLV_OK || - (cu = die_sibling(&dw, NULL)) == NULL || + &addrsz, &nxthdr, &dw.dw_err)) != DW_DLV_OK) + terminate("file does not contain valid DWARF data: %s\n", + dwarf_errmsg(dw.dw_err)); + + if ((cu = die_sibling(&dw, NULL)) == NULL || (child = die_child(&dw, cu)) == NULL) terminate("file does not contain dwarf type data " "(try compiling with -g)\n"); |