PIPS
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "boolean.h"
#include "arithmetique.h"
#include <time.h>
#include <signal.h>
#include <unistd.h>
#include "linear_assert.h"
Go to the source code of this file.
Data Structures | |
struct | linear_exception_holder |
A structure for the exception stack. More... | |
struct | timeout_t |
hold a timeout prescription More... | |
Macros | |
#define | MAX_STACKED_CONTEXTS 64 |
exception stack. More... | |
#define | exception_debug_message(type) |
#define | exception_debug_trace(type) |
#define | same_string_p(s1, s2) (strcmp((s1),(s2))==0) |
#define | throw_exception linear_throw_exception |
#define | TIMEOUT_MAX_STACK_SIZE 10 |
Functions | |
char const * | __attribute__ ((weak)) |
This can be overrided in the PolyLib. More... | |
void | linear_reset_error_counters (void) |
reset linear counters More... | |
unsigned int | linear_error_count (void) |
return number of linear errors may be used as a test after a reset to know whether new errors occured. More... | |
void | linear_get_error_counts (unsigned int *poe, unsigned int *pse, unsigned int *pme) |
return various errors counts through unsigned int pointer overflow, simplex & misc (aka others) NULL pointers are ignored More... | |
static void | linear_record_exception (const linear_exception_t exception) |
void | __attribute__ ((weak, noreturn)) |
throws an exception of a given type by searching for the specified 'what' in the current exception stack. More... | |
bool | linear_with_gmp (void) |
whether linear can use gmp (i.e. More... | |
bool | linear_require_gmp (void) |
whether linear is asked to use gmp if possible (env variable) More... | |
bool | linear_use_gmp (void) |
whether linear is to use gmp More... | |
void | set_timeout_callback (timeout_callback_f callback) |
static void | __attribute__ ((noreturn)) |
void | push_timeout (const unsigned int delay, const char *funcname, const char *filename, const int lineno) |
static int | env2int (const char *env) |
bool | push_timeout_env (const char *env, const char *funcname, const char *filename, const int lineno) |
void | pop_timeout (__attribute__((unused)) const char *funcname, __attribute__((unused)) const char *filename, __attribute__((unused)) const int lineno) |
void | pop_timeout_env (const char *env, const char *funcname, const char *filename, const int lineno) |
Variables | |
static int | timeout_index = 0 |
int | linear_assertion_result = -1 |
errors.c More... | |
static unsigned int | overflow_error_count = 0 |
static unsigned int | simplex_error_count = 0 |
static unsigned int | misc_error_count = 0 |
static bool | linear_exception_debug_mode = false |
whether to run in debug mode (that is to trace catch/uncatch/throw) More... | |
static unsigned int | linear_exception_verbose = 1 | 2 | 16 |
static linear_exception_holder | exception_stack [MAX_STACKED_CONTEXTS] |
static int | exception_index = 0 |
static exception_callback_t | push_callback = NULL |
callbacks... More... | |
static exception_callback_t | pop_callback = NULL |
static bool | warned_if_inconsistent_gmp = false |
static timeout_callback_f | timeout_callback = NULL |
a stack of timeouts is kept. More... | |
static timeout_t | timeouts [TIMEOUT_MAX_STACK_SIZE] |
#define exception_debug_message | ( | type | ) |
#define exception_debug_trace | ( | type | ) |
#define MAX_STACKED_CONTEXTS 64 |
#define throw_exception linear_throw_exception |
|
static |
Definition at line 512 of file errors.c.
References assert, timeout_t::delay, timeout_t::filename, fprintf(), timeout_t::funcname, timeout_t::lineno, POP_TIMEOUT, THROW, timeout_callback, timeout_error, timeout_index, and timeouts.
char const* __attribute__ | ( | (weak) | ) |
This can be overrided in the PolyLib.
This can be overridden in the PolyLib.
pop a what exception.
push a what exception on stack.
dump stack
total number of exceptions thrown, for statistics.
keep track of last thrown exception for RETHROW()
And seems to be according to gdb who cannot find the corresponding source code.
This can be overrided in the PolyLib
check for any mismatch! This can be overrided in the PolyLib
Definition at line 47 of file errors.c.
References any_exception_error, overflow_error, parser_exception_error, simplex_arithmetic_error, timeout_error, and user_exception_error.
void __attribute__ | ( | (weak, noreturn) | ) |
throws an exception of a given type by searching for the specified 'what' in the current exception stack.
This can be overridden in the PolyLib
Definition at line 337 of file errors.c.
References abort, dump_exception_stack(), exception_debug_message, exception_debug_trace, exception_index, exception_stack, exit, fprintf(), line, linear_exception_debug_mode, linear_exception_verbose, linear_number_of_exception_thrown, linear_record_exception(), pop_callback, POP_TIMEOUT, the_last_just_thrown_exception, timeout_error, and timeout_index.
|
static |
Definition at line 563 of file errors.c.
References env.
Referenced by pop_timeout_env(), and push_timeout_env().
unsigned int linear_error_count | ( | void | ) |
return number of linear errors may be used as a test after a reset to know whether new errors occured.
Definition at line 85 of file errors.c.
References misc_error_count, overflow_error_count, and simplex_error_count.
Referenced by catch_user_error().
return various errors counts through unsigned int pointer overflow, simplex & misc (aka others) NULL pointers are ignored
poe | oe |
pse | se |
pme | me |
Definition at line 94 of file errors.c.
References misc_error_count, overflow_error_count, and simplex_error_count.
Referenced by catch_user_error().
|
static |
Definition at line 102 of file errors.c.
References misc_error_count, overflow_error, overflow_error_count, parser_exception_error, simplex_arithmetic_error, simplex_error_count, timeout_error, and user_exception_error.
Referenced by __attribute__().
bool linear_require_gmp | ( | void | ) |
whether linear is asked to use gmp if possible (env variable)
Definition at line 446 of file errors.c.
References env.
Referenced by catch_user_error(), and linear_use_gmp().
void linear_reset_error_counters | ( | void | ) |
reset linear counters
Definition at line 75 of file errors.c.
References misc_error_count, overflow_error_count, and simplex_error_count.
Referenced by catch_user_error().
bool linear_use_gmp | ( | void | ) |
whether linear is to use gmp
Definition at line 454 of file errors.c.
References fprintf(), linear_require_gmp(), linear_with_gmp(), and warned_if_inconsistent_gmp.
Referenced by internal_sc_feasibility(), sc_convex_hull(), sc_to_sg_chernikova(), and sg_to_sc_chernikova().
bool linear_with_gmp | ( | void | ) |
whether linear can use gmp (i.e.
compiled in)
Definition at line 435 of file errors.c.
Referenced by catch_user_error(), and linear_use_gmp().
void pop_timeout | ( | __attribute__((unused)) const char * | funcname, |
__attribute__((unused)) const char * | filename, | ||
__attribute__((unused)) const int | lineno | ||
) |
Definition at line 591 of file errors.c.
References assert, timeout_t::end, timeout_index, and timeouts.
Referenced by pop_timeout_env().
void pop_timeout_env | ( | const char * | env, |
const char * | funcname, | ||
const char * | filename, | ||
const int | lineno | ||
) |
env | nv |
funcname | uncname |
filename | ilename |
lineno | ineno |
Definition at line 619 of file errors.c.
References env, env2int(), and pop_timeout().
void push_timeout | ( | const unsigned int | delay, |
const char * | funcname, | ||
const char * | filename, | ||
const int | lineno | ||
) |
delay | elay |
funcname | uncname |
filename | ilename |
lineno | ineno |
Definition at line 539 of file errors.c.
References assert, timeout_t::delay, timeout_t::end, timeout_t::env, timeout_t::filename, timeout_t::funcname, timeout_t::lineno, timeout_t::start, timeout_index, TIMEOUT_MAX_STACK_SIZE, and timeouts.
Referenced by push_timeout_env().
bool push_timeout_env | ( | const char * | env, |
const char * | funcname, | ||
const char * | filename, | ||
const int | lineno | ||
) |
env | nv |
funcname | uncname |
filename | ilename |
lineno | ineno |
Definition at line 575 of file errors.c.
References timeout_t::env, env, env2int(), push_timeout(), timeout_index, and timeouts.
void set_timeout_callback | ( | timeout_callback_f | callback | ) |
callback | allback |
Definition at line 485 of file errors.c.
References callback, and timeout_callback.
Referenced by set_pips_timeout(), and set_pips_timeout_from_env().
|
static |
Definition at line 150 of file errors.c.
Referenced by __attribute__().
|
static |
Definition at line 149 of file errors.c.
Referenced by __attribute__().
whether to run in debug mode (that is to trace catch/uncatch/throw)
Definition at line 121 of file errors.c.
Referenced by __attribute__().
|
static |
Definition at line 122 of file errors.c.
Referenced by __attribute__().
|
static |
Definition at line 71 of file errors.c.
Referenced by linear_error_count(), linear_get_error_counts(), linear_record_exception(), and linear_reset_error_counters().
|
static |
Definition at line 69 of file errors.c.
Referenced by linear_error_count(), linear_get_error_counts(), linear_record_exception(), and linear_reset_error_counters().
|
static |
Definition at line 155 of file errors.c.
Referenced by __attribute__().
|
static |
|
static |
Definition at line 70 of file errors.c.
Referenced by linear_error_count(), linear_get_error_counts(), linear_record_exception(), and linear_reset_error_counters().
|
static |
a stack of timeouts is kept.
this may make sense to deal with local timeouts within linear but still keeping a global outside timeout for pips. on timeouts, the corresponding exception is raised... what to do about it is unclear... probably the idea is to stop more or less cleanly.
Definition at line 483 of file errors.c.
Referenced by __attribute__(), and set_timeout_callback().
|
static |
Definition at line 40 of file errors.c.
Referenced by __attribute__(), pop_timeout(), push_timeout(), and push_timeout_env().
|
static |
Definition at line 509 of file errors.c.
Referenced by __attribute__(), pop_timeout(), push_timeout(), and push_timeout_env().
Definition at line 431 of file errors.c.
Referenced by linear_use_gmp().