Print this page


Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libdtrace/common/dt_open.c
          +++ new/usr/src/lib/libdtrace/common/dt_open.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright (c) 2015, Joyent, Inc.
       24 + * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  25   25   * Copyright (c) 2012, 2016 by Delphix. All rights reserved.
  26   26   */
  27   27  
  28   28  #include <sys/types.h>
  29   29  #include <sys/modctl.h>
  30   30  #include <sys/systeminfo.h>
  31   31  #include <sys/resource.h>
  32   32  
  33   33  #include <libelf.h>
  34   34  #include <strings.h>
↓ open down ↓ 1105 lines elided ↑ open up ↑
1140 1140          if (ctf_update(dmp->dm_ctfp) != 0) {
1141 1141                  dt_dprintf("failed to update C container: %s\n",
1142 1142                      ctf_errmsg(ctf_errno(dmp->dm_ctfp)));
1143 1143                  return (set_open_errno(dtp, errp, EDT_CTF));
1144 1144          }
1145 1145  
1146 1146          /*
1147 1147           * Add intrinsic pointer types that are needed to initialize printf
1148 1148           * format dictionary types (see table in dt_printf.c).
1149 1149           */
1150      -        (void) ctf_add_pointer(dmp->dm_ctfp, CTF_ADD_ROOT, NULL,
     1150 +        (void) ctf_add_pointer(dmp->dm_ctfp, CTF_ADD_ROOT,
1151 1151              ctf_lookup_by_name(dmp->dm_ctfp, "void"));
1152 1152  
1153      -        (void) ctf_add_pointer(dmp->dm_ctfp, CTF_ADD_ROOT, NULL,
     1153 +        (void) ctf_add_pointer(dmp->dm_ctfp, CTF_ADD_ROOT,
1154 1154              ctf_lookup_by_name(dmp->dm_ctfp, "char"));
1155 1155  
1156      -        (void) ctf_add_pointer(dmp->dm_ctfp, CTF_ADD_ROOT, NULL,
     1156 +        (void) ctf_add_pointer(dmp->dm_ctfp, CTF_ADD_ROOT,
1157 1157              ctf_lookup_by_name(dmp->dm_ctfp, "int"));
1158 1158  
1159 1159          if (ctf_update(dmp->dm_ctfp) != 0) {
1160 1160                  dt_dprintf("failed to update C container: %s\n",
1161 1161                      ctf_errmsg(ctf_errno(dmp->dm_ctfp)));
1162 1162                  return (set_open_errno(dtp, errp, EDT_CTF));
1163 1163          }
1164 1164  
1165 1165          /*
1166 1166           * Create a dynamic CTF container under the "D" scope for types that
↓ open down ↓ 39 lines elided ↑ open up ↑
1206 1206  
1207 1207          /*
1208 1208           * Insert a CTF ID corresponding to a pointer to a type of kind
1209 1209           * CTF_K_FUNCTION we can use in the compiler for function pointers.
1210 1210           * CTF treats all function pointers as "int (*)()" so we only need one.
1211 1211           */
1212 1212          ctc.ctc_return = ctf_lookup_by_name(dmp->dm_ctfp, "int");
1213 1213          ctc.ctc_argc = 0;
1214 1214          ctc.ctc_flags = 0;
1215 1215  
1216      -        dtp->dt_type_func = ctf_add_funcptr(dmp->dm_ctfp,
     1216 +        dtp->dt_type_func = ctf_add_function(dmp->dm_ctfp,
1217 1217              CTF_ADD_ROOT, &ctc, NULL);
1218 1218  
1219      -        dtp->dt_type_fptr = ctf_add_pointer(dmp->dm_ctfp, CTF_ADD_ROOT, NULL,
1220      -            dtp->dt_type_func);
     1219 +        dtp->dt_type_fptr = ctf_add_pointer(dmp->dm_ctfp,
     1220 +            CTF_ADD_ROOT, dtp->dt_type_func);
1221 1221  
1222 1222          /*
1223 1223           * We also insert CTF definitions for the special D intrinsic types
1224 1224           * string and <DYN> into the D container.  The string type is added
1225 1225           * as a typedef of char[n].  The <DYN> type is an alias for void.
1226 1226           * We compare types to these special CTF ids throughout the compiler.
1227 1227           */
1228 1228          ctr.ctr_contents = ctf_lookup_by_name(dmp->dm_ctfp, "char");
1229 1229          ctr.ctr_index = ctf_lookup_by_name(dmp->dm_ctfp, "long");
1230 1230          ctr.ctr_nelems = _dtrace_strsize;
↓ open down ↓ 215 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX