sort of/kind of support PANICTRACE on VMS (trunk only)

I don't think this is useful enough to recommend ordinary users
enable it, but it's close enough to being useful that I don't want
to leave it to become subject to bit rot like umpteen other unfinished
patches.  Anyone running in wizard mode who has a panic already gets
pushed into the debugger on VMS, although it doesn't work for what might
be considered the most important configuration (a secure playground, as
opposed to the wide-open one I've always been content to leave mine at).
This commit is contained in:
nethack.rankin
2011-04-24 08:16:22 +00:00
parent 4151ab500f
commit 0b97c1be42
6 changed files with 99 additions and 12 deletions

View File

@@ -160,7 +160,8 @@ boolean set;
# endif /* NO_SIGNAL */
static void
NH_abort(){
NH_abort()
{
int gdb_prio = SYSOPT_PANICTRACE_GDB;
int glibc_prio = SYSOPT_PANICTRACE_GLIBC;
static boolean aborting = FALSE;
@@ -168,6 +169,7 @@ NH_abort(){
if(aborting) return;
aborting = TRUE;
# ifndef VMS
if(gdb_prio == glibc_prio && gdb_prio > 0) gdb_prio++;
if(gdb_prio > glibc_prio){
@@ -176,6 +178,15 @@ NH_abort(){
NH_panictrace_glibc() || (gdb_prio && NH_panictrace_gdb());
}
# else /* VMS */
/* overload otherwise unused priority for debug mode: 1 = show
traceback and exit; 2 = show traceback and stay in debugger */
/* if (wizard && gdb_prio == 1) gdb_prio = 2; */
vms_traceback(gdb_prio);
(void)glibc_prio; /* half-hearted attempt at lint suppression */
# endif /* ?VMS */
# ifndef NO_SIGNAL
panictrace_setsignals(FALSE);
# endif
@@ -183,7 +194,8 @@ NH_abort(){
}
static boolean
NH_panictrace_glibc(){
NH_panictrace_glibc()
{
# ifdef PANICTRACE_GLIBC
void *bt[20];
size_t count;
@@ -218,7 +230,8 @@ NH_panictrace_glibc(){
# endif /* PANICTRACE_GDB */
static boolean
NH_panictrace_gdb(){
NH_panictrace_gdb()
{
# ifdef PANICTRACE_GDB
/* A (more) generic method to get a stack trace - invoke
* gdb on ourself. */