9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * CDDL HEADER START
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * The contents of this file are subject to the terms of the
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * Common Development and Distribution License (the "License").
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * You may not use this file except in compliance with the License.
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * See the License for the specific language governing permissions
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * and limitations under the License.
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * When distributing Covered Code, include this CDDL HEADER in each
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * If applicable, add the following below this CDDL HEADER, with the
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * fields enclosed by brackets "[]" replaced with your own identifying
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * information: Portions Copyright [yyyy] [name of copyright owner]
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * CDDL HEADER END
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * Use is subject to license terms.
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi#pragma ident "%Z%%M% %I% %E% SMI"
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi mdb_warn("failed to read ereport_errorq at %p", addr);
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi mdb_warn("errorq at %p does not service ereports", addr);
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi if (mdb_vread(&elem, sizeof (elem), addr) != sizeof (elem) ||
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi mdb_vread(&eqnp, sizeof (eqnp), (uintptr_t)elem.eqe_data)
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi mdb_warn("failed to read ereportq element at %p", addr);
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi return (wsp->walk_callback((uintptr_t)eqnp.eqn_nvl, &nvl,
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi mdb_warn("failed to read ereport_errorq at %p", addr);
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi mdb_warn("errorq at %p does not service ereports", addr);
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi if (mdb_vread(&elem, sizeof (elem), addr) != sizeof (elem) ||
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi mdb_vread(&eqnp, sizeof (eqnp), (uintptr_t)elem.eqe_data)
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi mdb_warn("failed to read ereportq element at %p", addr);
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi return (wsp->walk_callback((uintptr_t)eqnp.eqn_nvl, &nvl,
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi/*ARGSUSED*/
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindiereport(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi if (mdb_getopts(argc, argv, 'v', MDB_OPT_SETBITS, TRUE, &opt_v) != argc)
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * The following code attempts to pretty print the ereport class
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * and ENA. The code uses project private macros from libnvpair
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * that could change and break this functionality. If we are unable
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * to get a valid class and ENA from the nvpair list, we revert to
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * dumping the nvlist (same as opt_v).
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi if (mdb_vread(&nvpriv, sizeof (nvpriv), nvl.nvl_priv) == -1) {
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi mdb_warn("failed to read nvpriv at %p", nvl.nvl_priv);
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi for (nvcur = nvpriv.nvp_list; nvcur != NULL; nvcur = i_nvp.nvi_next) {
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi if (mdb_vread(&i_nvp, sizeof (i_nvp), (uintptr_t)nvcur) == -1) {
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi if (size == 0) {
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi /* read in the entire nvpair */
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi if (mdb_vread(nvpair, size, (uintptr_t)&nvcur->nvi_nvp) == -1) {
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi mdb_warn("failed to read nvpair and data at %p", nvp);
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi NVP_TYPE(nvpair) == DATA_TYPE_STRING && class == NULL) {
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi } else if (strcmp(FM_EREPORT_ENA, NVP_NAME(nvpair)) == 0 &&
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * Dump entire nvlist
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi ret = mdb_call_dcmd("nvlist", addr, flags | DCMD_ADDRSPEC,