Select Git revision
-
Henrik (Grubba) Grubbström authored
Rev: src/module.h:1.10
Henrik (Grubba) Grubbström authoredRev: src/module.h:1.10
error.c 11.31 KiB
/*\
||| This file a part of Pike, and is copyright by Fredrik Hubinette
||| Pike is distributed as GPL (General Public License)
||| See the files COPYING and DISCLAIMER for more information.
\*/
/**/
#include "global.h"
#include "pike_macros.h"
#include "error.h"
#include "interpret.h"
#include "stralloc.h"
#include "builtin_functions.h"
#include "array.h"
#include "object.h"
#include "main.h"
#include "builtin_functions.h"
#include "backend.h"
#include "operators.h"
#include "module_support.h"
#include "threads.h"
RCSID("$Id: error.c,v 1.44 2000/04/04 15:39:13 grubba Exp $");
#undef ATTRIBUTE
#define ATTRIBUTE(X)
JMP_BUF *recoveries=0;
#ifdef PIKE_DEBUG
void check_recovery_context(void)
{
char foo;
#define TESTILITEST ((((char *)recoveries)-((char *)&foo))*STACK_DIRECTION)
if(recoveries && TESTILITEST > 0)
fatal("Recoveries is out biking (recoveries=%p, sp=%p, %d)!\n",recoveries, &foo,TESTILITEST);
/* Add more stuff here when required */
}
void pike_gdb_breakpoint(void)
{
}
#endif
JMP_BUF *init_recovery(JMP_BUF *r DEBUG_LINE_ARGS)
{
check_recovery_context();
#ifdef PIKE_DEBUG
r->line=line;
r->file=file;
OED_FPRINTF((stderr, "init_recovery(%p) %s:%d\n", r, file, line));
#endif
r->fp=fp;
r->sp=sp-evaluator_stack;
r->mark_sp=mark_sp - mark_stack;
r->previous=recoveries;
r->onerror=0;
r->severity=THROW_ERROR;
recoveries=r;
check_recovery_context();
return r;
}
void pike_throw(void) ATTRIBUTE((noreturn))
{
while(recoveries && throw_severity > recoveries->severity)
{
while(recoveries->onerror)
{
(*recoveries->onerror->func)(recoveries->onerror->arg);