Print this page
10812 ctf tools shouldn't add blank labels
10813 ctf symbol mapping needs work
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libctf/common/ctf_convert.c
          +++ new/usr/src/lib/libctf/common/ctf_convert.c
↓ open down ↓ 2 lines elided ↑ open up ↑
   3    3   * Common Development and Distribution License ("CDDL"), version 1.0.
   4    4   * You may only use this file in accordance with the terms of version
   5    5   * 1.0 of the CDDL.
   6    6   *
   7    7   * A full copy of the text of the CDDL should have accompanied this
   8    8   * source.  A copy of the CDDL is also available via the Internet at
   9    9   * http://www.illumos.org/license/CDDL.
  10   10   */
  11   11  
  12   12  /*
  13      - * Copyright 2015 Joyent, Inc.
       13 + * Copyright 2019 Joyent, Inc.
  14   14   */
  15   15  
  16   16  /*
  17   17   * Main conversion entry points. This has been designed such that there can be
  18   18   * any number of different conversion backends. Currently we only have one that
  19   19   * understands DWARFv2 (and bits of DWARFv4). Each backend should be placed in
  20   20   * the ctf_converters list and each will be tried in turn.
  21   21   */
  22   22  
  23   23  #include <libctf_impl.h>
↓ open down ↓ 137 lines elided ↑ open up ↑
 161  161                          *errp = ECTF_CONVNOCSRC;
 162  162                          return (NULL);
 163  163                  }
 164  164                  *errp = ECTF_NOCONVBKEND;
 165  165                  return (NULL);
 166  166          }
 167  167  
 168  168          /*
 169  169           * Succsesful conversion.
 170  170           */
 171      -        if (fp != NULL) {
 172      -                if (label == NULL)
 173      -                        label = "";
      171 +        if (fp != NULL && label != NULL) {
 174  172                  if (ctf_add_label(fp, label, fp->ctf_typemax, 0) == CTF_ERR) {
 175  173                          *errp = ctf_errno(fp);
 176  174                          ctf_close(fp);
 177  175                          return (NULL);
 178  176                  }
 179  177                  if (ctf_update(fp) == CTF_ERR) {
 180  178                          *errp = ctf_errno(fp);
 181  179                          ctf_close(fp);
 182  180                          return (NULL);
 183  181                  }
↓ open down ↓ 27 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX