Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet/dist/tools/ctf/cvt - don't barf if the o...



details:   https://anonhg.NetBSD.org/src/rev/872d55646d1c
branches:  trunk
changeset: 813812:872d55646d1c
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Feb 20 02:39:47 2016 +0000

description:
- 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).

diffstat:

 external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 8050409e4243 -r 872d55646d1c external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c
--- a/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c    Sat Feb 20 01:43:28 2016 +0000
+++ b/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c    Sat Feb 20 02:39:47 2016 +0000
@@ -1325,7 +1325,7 @@
 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 @@
        }
 
        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;



Home | Main Index | Thread Index | Old Index