Print this page
11584 ::xcall would be useful
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>


   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 /*
  26  * Copyright (c) 2013, 2015 by Delphix. All rights reserved.
  27  * Copyright (c) 2015, Joyent, Inc.
  28  */
  29 
  30 #ifndef _MDB_CTF_H
  31 #define _MDB_CTF_H
  32 
  33 #include <mdb/mdb_target.h>
  34 #include <libctf.h>
  35 
  36 #ifdef _MDB
  37 #include <sys/machelf.h>
  38 #endif
  39 
  40 /*
  41  * The following directive tells the mapfile generator that prototypes and
  42  * declarations ending with an "Internal" comment should be excluded from the
  43  * mapfile.
  44  *
  45  * MAPFILE: exclude "Internal"
  46  */
  47 


 125     const mdb_ctf_id_t *, mdb_ctf_id_t *);
 126 extern int mdb_ctf_add_array(const mdb_ctf_arinfo_t *, mdb_ctf_id_t *);
 127 extern int mdb_ctf_add_pointer(const mdb_ctf_id_t *, mdb_ctf_id_t *);
 128 
 129 /* utility stuff */
 130 extern ctf_id_t mdb_ctf_type_id(mdb_ctf_id_t);
 131 extern ctf_file_t *mdb_ctf_type_file(mdb_ctf_id_t);
 132 
 133 
 134 extern int mdb_ctf_member_info(mdb_ctf_id_t, const char *,
 135     ulong_t *, mdb_ctf_id_t *);
 136 extern int mdb_ctf_offsetof(mdb_ctf_id_t, const char *, ulong_t *);
 137 extern int mdb_ctf_num_members(mdb_ctf_id_t);
 138 extern int mdb_ctf_offsetof_by_name(const char *, const char *);
 139 extern ssize_t mdb_ctf_sizeof_by_name(const char *);
 140 
 141 extern ssize_t mdb_ctf_offset_to_name(mdb_ctf_id_t, ulong_t, char *, size_t,
 142     int, mdb_ctf_id_t *, ulong_t *);
 143 
 144 #define MDB_CTF_VREAD_QUIET             0x100

 145 
 146 extern int mdb_ctf_vread(void *, const char *, const char *,
 147     uintptr_t, uint_t);
 148 extern int mdb_ctf_readsym(void *, const char *, const char *, uint_t);
 149 
 150 #ifdef _MDB
 151 
 152 extern ctf_file_t *mdb_ctf_open(const char *, int *);           /* Internal */
 153 extern ctf_file_t *mdb_ctf_bufopen(const void *, size_t,        /* Internal */
 154     const void *, Shdr *, const void *, Shdr *, int *);
 155 extern int mdb_ctf_write(const char *, ctf_file_t *fp);         /* Internal */
 156 extern void mdb_ctf_close(ctf_file_t *fp);                      /* Internal */
 157 extern int mdb_ctf_synthetics_init(void);                       /* Internal */
 158 extern void mdb_ctf_synthetics_fini(void);                      /* Internal */
 159 extern int mdb_ctf_synthetics_from_file(const char *);          /* Internal */
 160 extern int mdb_ctf_synthetics_to_file(const char *);            /* Internal */
 161 
 162 #endif
 163 
 164 #ifdef  __cplusplus


   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 /*
  26  * Copyright (c) 2013, 2015 by Delphix. All rights reserved.
  27  * Copyright 2018 Joyent, Inc.
  28  */
  29 
  30 #ifndef _MDB_CTF_H
  31 #define _MDB_CTF_H
  32 
  33 #include <mdb/mdb_target.h>
  34 #include <libctf.h>
  35 
  36 #ifdef _MDB
  37 #include <sys/machelf.h>
  38 #endif
  39 
  40 /*
  41  * The following directive tells the mapfile generator that prototypes and
  42  * declarations ending with an "Internal" comment should be excluded from the
  43  * mapfile.
  44  *
  45  * MAPFILE: exclude "Internal"
  46  */
  47 


 125     const mdb_ctf_id_t *, mdb_ctf_id_t *);
 126 extern int mdb_ctf_add_array(const mdb_ctf_arinfo_t *, mdb_ctf_id_t *);
 127 extern int mdb_ctf_add_pointer(const mdb_ctf_id_t *, mdb_ctf_id_t *);
 128 
 129 /* utility stuff */
 130 extern ctf_id_t mdb_ctf_type_id(mdb_ctf_id_t);
 131 extern ctf_file_t *mdb_ctf_type_file(mdb_ctf_id_t);
 132 
 133 
 134 extern int mdb_ctf_member_info(mdb_ctf_id_t, const char *,
 135     ulong_t *, mdb_ctf_id_t *);
 136 extern int mdb_ctf_offsetof(mdb_ctf_id_t, const char *, ulong_t *);
 137 extern int mdb_ctf_num_members(mdb_ctf_id_t);
 138 extern int mdb_ctf_offsetof_by_name(const char *, const char *);
 139 extern ssize_t mdb_ctf_sizeof_by_name(const char *);
 140 
 141 extern ssize_t mdb_ctf_offset_to_name(mdb_ctf_id_t, ulong_t, char *, size_t,
 142     int, mdb_ctf_id_t *, ulong_t *);
 143 
 144 #define MDB_CTF_VREAD_QUIET             0x100
 145 #define MDB_CTF_VREAD_IGNORE_ABSENT     0x200
 146 
 147 extern int mdb_ctf_vread(void *, const char *, const char *,
 148     uintptr_t, uint_t);
 149 extern int mdb_ctf_readsym(void *, const char *, const char *, uint_t);
 150 
 151 #ifdef _MDB
 152 
 153 extern ctf_file_t *mdb_ctf_open(const char *, int *);           /* Internal */
 154 extern ctf_file_t *mdb_ctf_bufopen(const void *, size_t,        /* Internal */
 155     const void *, Shdr *, const void *, Shdr *, int *);
 156 extern int mdb_ctf_write(const char *, ctf_file_t *fp);         /* Internal */
 157 extern void mdb_ctf_close(ctf_file_t *fp);                      /* Internal */
 158 extern int mdb_ctf_synthetics_init(void);                       /* Internal */
 159 extern void mdb_ctf_synthetics_fini(void);                      /* Internal */
 160 extern int mdb_ctf_synthetics_from_file(const char *);          /* Internal */
 161 extern int mdb_ctf_synthetics_to_file(const char *);            /* Internal */
 162 
 163 #endif
 164 
 165 #ifdef  __cplusplus