/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Handling of unintentional faults (i.e. bugs) in the debugger.
*/
#include <stdlib.h>
#include <kmdb/kmdb_fault.h>
#include <kmdb/kmdb_promif.h>
#include <kmdb/kmdb_kdi.h>
#include <kmdb/kmdb_dpi.h>
#include <mdb/mdb_debug.h>
#include <mdb/mdb_kreg.h>
#include <mdb/mdb_io_impl.h>
void
{
char c;
/* Make absolutely sure */
try = 1;
if (++try == 2) {
"\n*** First stack trace attempt failed. "
"Trying safe mode.\n\n");
} else {
"\n*** Unable to print stack trace.\n");
}
} else {
cpuid);
}
for (;;) {
#if defined(__sparc)
#ifndef sun4v
"(o)bp, "
#endif /* sun4v */
"(p)anic"
#else
"reboo(t)"
#endif
goto fault_obp;
switch (c) {
#ifdef __sparc
case 'p':
/*NOTREACHED*/
continue;
#endif
#ifndef sun4v
case 'o':
case 'O':
#endif /* sun4v */
case 't':
case 'T':
continue;
case 'd':
case 'D':
/*
* Debug self - get confirmation, because they
* can't go back to their running system if
* they choose this one.
*/
if (debug_self_confirm == 0) {
"NOTE: You will not be able to "
"resume your system if you "
"choose this option.\nPlease "
"select 'd' again to confirm.\n");
debug_self_confirm = 1;
continue;
}
return;
}
}
}
exit(1);
/*NOTREACHED*/
}