PIPS
exception.c File Reference
#include <stdio.h>
#include <genC.h>
#include "misc.h"
+ Include dependency graph for exception.c:

Go to the source code of this file.

Functions

void push_pips_context (char const *file, char const *function, int line)
 exception.c More...
 
void pop_pips_context (char const *file, char const *function, int line)
 

Variables

static stack debug_stack = NULL
 Stack management for PIPS contexts. More...
 

Function Documentation

◆ pop_pips_context()

void pop_pips_context ( char const *  file,
char const *  function,
int  line 
)
Parameters
fileile
functionunction
lineine

Definition at line 50 of file exception.c.

51 {
52  pips_debug(9, "%s %s:%d\n", function, file, line);
53  if (!debug_stack)
54  pips_internal_error("unexpected pop without push %s %s:%d",
55  function, file, line);
57 }
static stack debug_stack
Stack management for PIPS contexts.
Definition: exception.c:41
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
#define pips_internal_error
Definition: misc-local.h:149
void set_debug_stack_pointer(const int i)
Definition: debug.c:97
void * stack_pop(stack)
POPs one item from stack s.
Definition: stack.c:399
intptr_t _int
_INT
Definition: newgen_types.h:53
static int line
FLEX_SCANNER.
Definition: scanner.c:852

References debug_stack, line, pips_debug, pips_internal_error, set_debug_stack_pointer(), and stack_pop().

Referenced by atinit(), gpips_main(), pips_main(), tpips_main(), and wpips_main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ push_pips_context()

void push_pips_context ( char const *  file,
char const *  function,
int  line 
)

exception.c

Parameters
fileile
functionunction
lineine

Definition at line 43 of file exception.c.

44 {
45  pips_debug(9, "%s %s:%d\n", function, file, line);
46  if (!debug_stack) debug_stack = stack_make(0, 50, 0);
48 }
_int get_debug_stack_pointer(void)
The pair get_ and set_debug_stack_pointer() should never be used except to clean up the stack after a...
Definition: debug.c:92
void stack_push(void *, stack)
stack use
Definition: stack.c:373
stack stack_make(int, int, int)
allocation
Definition: stack.c:246

References debug_stack, get_debug_stack_pointer(), line, pips_debug, stack_make(), and stack_push().

Referenced by atinit(), gpips_main(), pips_main(), tpips_main(), and wpips_main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ debug_stack

stack debug_stack = NULL
static

Stack management for PIPS contexts.

A PIPS context contains a pointer in the PIPS debug level stack. When a PIPS context is popped, the debug level stack is restored. It may be the current level!

Example: voir catch_user_error() in library pipmake, or a PIPS user interface such as wpips, tpips or pips

Definition at line 41 of file exception.c.

Referenced by pop_pips_context(), and push_pips_context().