PIPS
|
#include <stdarg.h>
#include <stdlib.h>
#include <setjmp.h>
Go to the source code of this file.
Macros | |
#define | TIMEOUT_CODE (128+14) |
#define | STRINGIFY_SECOND_STAGE(symbol) #symbol |
To generate a string from a macro: More... | |
#define | STRINGIFY(symbol) STRINGIFY_SECOND_STAGE(symbol) |
If not using this 2-stage macro evaluation, the generated string is not the value of the macro but the name of the macro... More... | |
#define | abort() pips_stop(internal_error_log, -1, "abort() called") |
#define | exit(code) pips_stop(user_error_log, code, "exit(%d) called", code) |
#define | pips_unknown_function "Unknown Function Name" |
#define | CURRENT_FUNCTION pips_unknown_function |
#define | pips_debug pips_debug_func2 |
these macros use the GNU extensions that allow variadic macros, including with an empty list. More... | |
#define | pips_user_warning pips_user_warning_func2 |
#define | pips_user_error pips_user_error_func2 |
#define | pips_user_irrecoverable_error pips_user_irrecoverable_error_func2 |
#define | pips_internal_error pips_internal_error_func2 |
#define | pips_log pips_log_func2 |
#define | pips_stop pips_stop_func2 |
#define | pips_where(out) fprintf(out, "[%s] (%s:%d) ", CURRENT_FUNCTION, __FILE__, __LINE__) |
#define | debug_on(env) debug_on_function(env, CURRENT_FUNCTION, __FILE__, __LINE__) |
#define | debug_off() debug_off_function(CURRENT_FUNCTION, __FILE__, __LINE__) |
#define | pips_assert(what, predicate) |
common macros, two flavors depending on NDEBUG More... | |
#define | pips_user_assert(what, predicate) |
#define | ifdebug(l) if (the_current_debug_level>=(l)) |
#define | pips_exit(code, format, args...) pips_user_warning(format, ##args), exit(code) |
#define | same_string_p(s1, s2) function_same_string_p(s1,s2) |
FI:need to breakpoint while inlining is available. More... | |
#define | same_stringn_p(a, b, c) (!strncmp((a),(b),(c))) |
#define | MAXPATHLEN 1024 |
MAXPATHLEN is defined in <sys/param.h> for SunOS... More... | |
#define | PIPS_CATCH(what) |
#define | SIGN_EQ(a, b) ((((a)>0 && (b)>0) || ((a)<0 && (b)<0)) ? true : false) |
SG moved there from transformation.h. More... | |
#define | FORTRAN_DIV(n, d) (SIGN_EQ((n),(d)) ? ABS(n)/ABS(d) : -(ABS(n)/ABS(d))) |
#define | C_DIVISION(n, d) ((n)/(d)) |
#define | FORTRAN_MOD(n, m) (SIGN_EQ((n),(m)) ? ABS(n)%ABS(m) : -(ABS(n)%ABS(m))) |
#define | C_MODULO(n, m) ((n)%(m)) |
#define | asprintf safe_asprintf |
#define | vasprintf safe_vasprintf |
#define | __has_attribute(att) 0 |
#define | _UNUSED_ __attribute__((unused)) |
#define | _NORETURN_ __attribute__((noreturn)) |
#define | _FALLTHROUGH_ |
#define | user_warning(fn, ...) pips_user_warning_func(fn, __FILE__, __LINE__, __VA_ARGS__) |
#define | user_error(fn, ...) pips_user_error_func(fn, __FILE__, __LINE__, __VA_ARGS__) |
Typedefs | |
typedef void(* | reset_func_t) (void) |
Enumerations | |
enum | pips_log_t { none_log , info_log , warning_log , spear_warning_log , spear_error_log , user_error_log , internal_error_log , irrecoverable_error_log , none_log , info_log , warning_log , spear_warning_log , spear_error_log , user_error_log , internal_error_log , irrecoverable_error_log } |
enum | measurement_type { SBRK_MEASURE , NET_MEASURE , GROSS_MEASURE , SBRK_MEASURE , NET_MEASURE , GROSS_MEASURE } |
Measurement type for mem_spy.c. More... | |
Functions | |
void _NORETURN_ | pips_stop_func (const char *, const char *, const int, pips_log_t, int, const string,...) |
expecititely declare "noreturn" functions... More... | |
void _NORETURN_ | pips_internal_error_func (const char *, const char *, const int, const char *,...) |
void _NORETURN_ | pips_user_error_func (const char *, const char *, const int, const char *,...) |
void _NORETURN_ | pips_user_irrecoverable_error_alist (const char *, const char *, const int, const char *, va_list *) |
void _NORETURN_ | pips_user_irrecoverable_error_func (const char *, const char *, const int, const char *,...) |
void _NORETURN_ | pips_stop_func2 (pips_log_t, int, const string,...) |
void _NORETURN_ | pips_internal_error_func2 (const char *,...) |
void _NORETURN_ | pips_user_error_func2 (const char *,...) |
void _NORETURN_ | pips_user_irrecoverable_error_func2 (const char *,...) |
Variables | |
int | the_current_debug_level |
Debugging functions. More... | |
#define __has_attribute | ( | att | ) | 0 |
Definition at line 229 of file misc-local.h.
#define _FALLTHROUGH_ |
Definition at line 238 of file misc-local.h.
#define _NORETURN_ __attribute__((noreturn)) |
Definition at line 233 of file misc-local.h.
#define _UNUSED_ __attribute__((unused)) |
Definition at line 232 of file misc-local.h.
#define abort | ( | ) | pips_stop(internal_error_log, -1, "abort() called") |
Definition at line 53 of file misc-local.h.
#define asprintf safe_asprintf |
Definition at line 225 of file misc-local.h.
#define C_DIVISION | ( | n, | |
d | |||
) | ((n)/(d)) |
Definition at line 214 of file misc-local.h.
#define C_MODULO | ( | n, | |
m | |||
) | ((n)%(m)) |
Definition at line 216 of file misc-local.h.
#define CURRENT_FUNCTION pips_unknown_function |
Definition at line 71 of file misc-local.h.
#define debug_off | ( | ) | debug_off_function(CURRENT_FUNCTION, __FILE__, __LINE__) |
Definition at line 160 of file misc-local.h.
#define debug_on | ( | env | ) | debug_on_function(env, CURRENT_FUNCTION, __FILE__, __LINE__) |
Definition at line 157 of file misc-local.h.
#define exit | ( | code | ) | pips_stop(user_error_log, code, "exit(%d) called", code) |
Definition at line 54 of file misc-local.h.
Definition at line 213 of file misc-local.h.
Definition at line 215 of file misc-local.h.
#define ifdebug | ( | l | ) | if (the_current_debug_level>=(l)) |
Definition at line 189 of file misc-local.h.
#define MAXPATHLEN 1024 |
MAXPATHLEN is defined in <sys/param.h> for SunOS...
but not for all OS!
Definition at line 203 of file misc-local.h.
#define pips_assert | ( | what, | |
predicate | |||
) |
common macros, two flavors depending on NDEBUG
Definition at line 172 of file misc-local.h.
#define PIPS_CATCH | ( | what | ) |
Definition at line 206 of file misc-local.h.
#define pips_debug pips_debug_func2 |
these macros use the GNU extensions that allow variadic macros, including with an empty list.
if not available, function calls are used.
a slightly better job could be done if C99 is assumed.
Definition at line 145 of file misc-local.h.
#define pips_exit | ( | code, | |
format, | |||
args... | |||
) | pips_user_warning(format, ##args), exit(code) |
Definition at line 193 of file misc-local.h.
#define pips_internal_error pips_internal_error_func2 |
Definition at line 149 of file misc-local.h.
#define pips_log pips_log_func2 |
Definition at line 150 of file misc-local.h.
#define pips_stop pips_stop_func2 |
Definition at line 151 of file misc-local.h.
#define pips_unknown_function "Unknown Function Name" |
Definition at line 63 of file misc-local.h.
#define pips_user_assert | ( | what, | |
predicate | |||
) |
Definition at line 181 of file misc-local.h.
#define pips_user_error pips_user_error_func2 |
Definition at line 147 of file misc-local.h.
#define pips_user_irrecoverable_error pips_user_irrecoverable_error_func2 |
Definition at line 148 of file misc-local.h.
#define pips_user_warning pips_user_warning_func2 |
Definition at line 146 of file misc-local.h.
Definition at line 154 of file misc-local.h.
#define same_string_p | ( | s1, | |
s2 | |||
) | function_same_string_p(s1,s2) |
FI:need to breakpoint while inlining is available.
#define same_string_p(s1, s2) (strcmp((s1), (s2)) == 0)
Definition at line 198 of file misc-local.h.
#define same_stringn_p | ( | a, | |
b, | |||
c | |||
) | (!strncmp((a),(b),(c))) |
Definition at line 199 of file misc-local.h.
SG moved there from transformation.h.
Definition at line 212 of file misc-local.h.
#define STRINGIFY | ( | symbol | ) | STRINGIFY_SECOND_STAGE(symbol) |
If not using this 2-stage macro evaluation, the generated string is not the value of the macro but the name of the macro...
Who said C was a simple language? :-/
Definition at line 50 of file misc-local.h.
To generate a string from a macro:
Definition at line 46 of file misc-local.h.
#define TIMEOUT_CODE (128+14) |
Definition at line 43 of file misc-local.h.
#define user_error | ( | fn, | |
... | |||
) | pips_user_error_func(fn, __FILE__, __LINE__, __VA_ARGS__) |
Definition at line 265 of file misc-local.h.
#define user_warning | ( | fn, | |
... | |||
) | pips_user_warning_func(fn, __FILE__, __LINE__, __VA_ARGS__) |
Definition at line 262 of file misc-local.h.
#define vasprintf safe_vasprintf |
Definition at line 226 of file misc-local.h.
typedef void(* reset_func_t) (void) |
Definition at line 222 of file misc-local.h.
enum measurement_type |
Measurement type for mem_spy.c.
Enumerator | |
---|---|
SBRK_MEASURE | |
NET_MEASURE | |
GROSS_MEASURE | |
SBRK_MEASURE | |
NET_MEASURE | |
GROSS_MEASURE |
Definition at line 57 of file misc-local.h.
enum pips_log_t |
Definition at line 31 of file misc-local.h.
void _NORETURN_ pips_internal_error_func | ( | const char * | funcname, |
const char * | funcfile, | ||
const int | funcline, | ||
const char * | fmt, | ||
... | |||
) |
funcname | uncname |
funcfile | uncfile |
funcline | uncline |
fmt | mt |
Definition at line 394 of file message.c.
void _NORETURN_ pips_internal_error_func2 | ( | const char * | format, |
... | |||
) |
void _NORETURN_ pips_stop_func | ( | const char * | pips_func, |
const char * | pips_file, | ||
const int | pips_line, | ||
pips_log_t | tag, | ||
int | code, | ||
const | string, | ||
... | |||
) |
expecititely declare "noreturn" functions...
because cproto generated headers seem to ignore attributes
pips_func | ips_func |
pips_file | ips_file |
pips_line | ips_line |
code | ode |
string | ormat |
Definition at line 904 of file message.c.
void _NORETURN_ pips_stop_func2 | ( | pips_log_t | tag, |
int | code, | ||
const | string, | ||
... | |||
) |
void _NORETURN_ pips_user_error_func | ( | const char * | func_name, |
const char * | funcfile, | ||
const int | funcline, | ||
const char * | format, | ||
... | |||
) |
func_name | unc_name |
funcfile | uncfile |
funcline | uncline |
format | ormat |
Definition at line 478 of file message.c.
void _NORETURN_ pips_user_error_func2 | ( | const char * | format, |
... | |||
) |
void _NORETURN_ pips_user_irrecoverable_error_alist | ( | const char * | func_name, |
const char * | funcfile, | ||
const int | funcline, | ||
const char * | format, | ||
va_list * | args | ||
) |
func_name | unc_name |
funcfile | uncfile |
funcline | uncline |
format | ormat |
args | rgs |
Definition at line 516 of file message.c.
void _NORETURN_ pips_user_irrecoverable_error_func | ( | const char * | func_name, |
const char * | funcfile, | ||
const int | funcline, | ||
const char * | format, | ||
... | |||
) |
func_name | unc_name |
funcfile | uncfile |
funcline | uncline |
format | ormat |
Definition at line 535 of file message.c.
void _NORETURN_ pips_user_irrecoverable_error_func2 | ( | const char * | format, |
... | |||
) |
|
extern |
Debugging functions.
cproto-generated files
Modifications:
debug.c