Print this page
libdtrace: attempt to resolve FORWARD types to concrete types

@@ -48,10 +48,11 @@
 dt_xlator_create_member(const char *name, ctf_id_t type, ulong_t off, void *arg)
 {
         dt_xlator_t *dxp = arg;
         dtrace_hdl_t *dtp = dxp->dx_hdl;
         dt_node_t *enp, *mnp;
+        ctf_file_t *ctfp;
 
         if ((enp = dt_node_xalloc(dtp, DT_NODE_XLATOR)) == NULL)
                 return (dt_set_errno(dtp, EDT_NOMEM));
 
         enp->dn_link = dxp->dx_nodes;

@@ -69,11 +70,18 @@
          * the current member.  These refs will be used by dt_cg.c and dt_as.c.
          */
         enp->dn_op = DT_TOK_XLATE;
         enp->dn_xlator = dxp;
         enp->dn_xmember = mnp;
-        dt_node_type_assign(enp, dxp->dx_dst_ctfp, type, B_FALSE);
+        /*
+         * XXX: Is it ok for the CTF of the type to not be from the dst ctf?
+         *
+         * I suspect it's actually unnecessary, but I'm also unclear on
+         * dynamic translators
+         */
+        dt_resolve_forward_decl(&ctfp, &type);
+        dt_node_type_assign(enp, ctfp, type, B_FALSE);
 
         /*
          * For the member itself, we use a DT_NODE_MEMBER as usual with the
          * appropriate name, output type, and member expression set to 'enp'.
          */