StuBS
Debugging Tools

Support debugging of the operating system. More...

Files

file  state.h
 GDB_Stub State of the current core
 
file  stub.h
 GDB_Stub contains the necessary functionality for remote debugging
 

Macros

#define STRINGIFY(S)   #S
 Converts a macro parameter into a string. More...
 
#define assert_size(TYPE, SIZE)    static_assert(sizeof(TYPE) == (SIZE), "Wrong size for " STRINGIFY(TYPE))
 Statically ensure (at compile time) that a data type (or variable) has the expected size. More...
 
#define assert(EXP)
 Ensure (at execution time) an expression evaluates to true, print an error message and stop the CPU otherwise. More...
 
#define kernelpanic(MSG)
 Print an error message in the debug window and stop the current core. More...
 

Detailed Description

Support debugging of the operating system.

Macro Definition Documentation

◆ STRINGIFY

#define STRINGIFY (   S)    #S

Converts a macro parameter into a string.

Parameters
SExpression to be converted
Returns
stringified version of S

◆ assert_size

#define assert_size (   TYPE,
  SIZE 
)     static_assert(sizeof(TYPE) == (SIZE), "Wrong size for " STRINGIFY(TYPE))

Statically ensure (at compile time) that a data type (or variable) has the expected size.

Parameters
TYPEThe type to be checked
SIZEExpected size in bytes

◆ assert

#define assert (   EXP)
Value:
do { \
if (__builtin_expect(!(EXP), 0)) { \
assertion_failed(STRINGIFY(EXP), __func__, __FILE__, __LINE__); \
} \
} while (false)
#define STRINGIFY(S)
Converts a macro parameter into a string.
Definition: assert.h:18

Ensure (at execution time) an expression evaluates to true, print an error message and stop the CPU otherwise.

Parameters
EXPThe expression to be checked

◆ kernelpanic

#define kernelpanic (   MSG)
Value:
do { \
DBG << "PANIC: '" << (MSG) << "' in " << __func__ \
<< " @ " << __FILE__ << ":" << __LINE__ \
<< flush; \
} while (0)
void die()
Permanently halts the core.
Definition: core.h:107
OutputStream & flush(OutputStream &os)
Enforces a buffer flush.
Definition: outputstream.cc:124

Print an error message in the debug window and stop the current core.

Parameters
MSGerror message