[Krafton Jungle] PintOS 2.0.0
크래프톤 정글 PintOS
 
Loading...
Searching...
No Matches
debug.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define UNUSED   __attribute__ ((unused))
 
#define NO_RETURN   __attribute__ ((noreturn))
 
#define NO_INLINE   __attribute__ ((noinline))
 
#define PRINTF_FORMAT(FMT, FIRST)   __attribute__ ((format (printf, FMT, FIRST)))
 
#define PANIC(...)   debug_panic (__FILE__, __LINE__, __func__, __VA_ARGS__)
 
#define ASSERT(CONDITION)
 
#define NOT_REACHED()   PANIC ("executed an unreachable statement");
 

Functions

void debug_panic (const char *file, int line, const char *function, const char *message,...) PRINTF_FORMAT(4
 
void debug_backtrace (void)
 

Variables

void NO_RETURN
 

Macro Definition Documentation

◆ ASSERT

#define ASSERT (   CONDITION)
Value:
if ((CONDITION)) { } else { \
PANIC ("assertion `%s' failed.", #CONDITION); \
}

◆ NO_INLINE

#define NO_INLINE   __attribute__ ((noinline))

◆ NO_RETURN

#define NO_RETURN   __attribute__ ((noreturn))

◆ NOT_REACHED

#define NOT_REACHED ( )    PANIC ("executed an unreachable statement");

◆ PANIC

#define PANIC (   ...)    debug_panic (__FILE__, __LINE__, __func__, __VA_ARGS__)

◆ PRINTF_FORMAT

#define PRINTF_FORMAT (   FMT,
  FIRST 
)    __attribute__ ((format (printf, FMT, FIRST)))

◆ UNUSED

#define UNUSED   __attribute__ ((unused))

Function Documentation

◆ debug_backtrace()

void debug_backtrace ( void  )
13 {
14 static bool explained;
15 void **frame;
16
17 printf ("Call stack:");
18 for (frame = __builtin_frame_address (0);
19 frame != NULL && frame[0] != NULL;
20 frame = frame[0])
21 printf (" %p", frame[1]);
22 printf (".\n");
23
24 if (!explained) {
25 explained = true;
26 printf ("The `backtrace' program can make call stacks useful.\n"
27 "Read \"Backtraces\" in the \"Debugging Tools\" chapter\n"
28 "of the Pintos documentation for more information.\n");
29 }
30}
#define NULL
Definition: stddef.h:4
int printf(const char *,...) PRINTF_FORMAT(1
Definition: vm.h:77
Here is the call graph for this function:
Here is the caller graph for this function:

◆ debug_panic()

void debug_panic ( const char *  file,
int  line,
const char *  function,
const char *  message,
  ... 
)

Variable Documentation

◆ NO_RETURN

void NO_RETURN