L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
kdebug.h File Reference

Functionality for invoking the kernel debugger. More...

#include <l4/sys/compiler.h>
#include <l4/sys/consts.h>
#include <l4/sys/ipc.h>
+ Include dependency graph for kdebug.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  l4_kdebug_ops_t
 Op-codes for operations that can be invoked on the base debugger capability. More...
 

Functions

void enter_kdebug (char const *text) L4_NOTHROW
 Enter the kernel debugger.
 
l4_msgtag_t __kdebug_op (unsigned op) L4_NOTHROW
 Invoke a nullary operation on the base debugger capability.
 
l4_msgtag_t __kdebug_text (unsigned op, char const *text, unsigned len) L4_NOTHROW
 Invoke a text output operation on the base debugger capability.
 
l4_msgtag_t __kdebug_3_text (unsigned op, char const *text, unsigned len, l4_umword_t v1, l4_umword_t v2, l4_umword_t v3) L4_NOTHROW
 Invoke a text output operation with 3 additional machine word arguments on the base debugger capability.
 
l4_msgtag_t __kdebug_op_1 (unsigned op, l4_mword_t val) L4_NOTHROW
 Invoke an unary operation on the base debugger capability.
 
void outnstring (char const *text, unsigned len)
 Output a fixed-length string via the kernel debugger.
 
void outstring (char const *text)
 Output a string via the kernel debugger.
 
void outchar (char c)
 Output a single character via the kernel debugger.
 
void outumword (l4_umword_t number)
 Output a hexadecimal unsigned machine word via the kernel debugger.
 
void outhex64 (l4_uint64_t number)
 Output a 64-bit unsigned hexadecimal number via the kernel debugger.
 
void outhex32 (l4_uint32_t number)
 Output a 32-bit unsigned hexadecimal number via the kernel debugger.
 
void outhex20 (l4_uint32_t number)
 Output a 20-bit unsigned hexadecimal number via the kernel debugger.
 
void outhex16 (l4_uint16_t number)
 Output a 16-bit unsigned hexadecimal number via the kernel debugger.
 
void outhex12 (l4_uint16_t number)
 Output a 12-bit unsigned hexadecimal number via the kernel debugger.
 
void outhex8 (l4_uint8_t number)
 Output an 8-bit unsigned hexadecimal number via the kernel debugger.
 
void outdec (l4_mword_t number)
 Output a decimal unsigned machine word via the kernel debugger.
 

Detailed Description

Functionality for invoking the kernel debugger.

Definition in file kdebug.h.

Enumeration Type Documentation

◆ l4_kdebug_ops_t

Op-codes for operations that can be invoked on the base debugger capability.

See also __ktrace-impl.h for additional op-codes.

Definition at line 42 of file kdebug.h.

Function Documentation

◆ __kdebug_3_text()

l4_msgtag_t __kdebug_3_text ( unsigned  op,
char const *  text,
unsigned  len,
l4_umword_t  v1,
l4_umword_t  v2,
l4_umword_t  v3 
)
inline

Invoke a text output operation with 3 additional machine word arguments on the base debugger capability.

Parameters
opText output operation code from l4_kdebug_ops_t or a value above 0x200 used by the kernel trace buffer implementation (__ktrace-impl.h).
textOutput string.
lenLength of the output string. The maximum length is limited to L4_UTCB_GENERIC_DATA_SIZE - 5 machine words. Output strings longer than this limit will be cropped.
v1First machine word argument.
v2Second machine word argument.
v3Third machine word argument.
Return values
Messagetag returned from the IPC on the base debugger capability.

Definition at line 137 of file kdebug.h.

References L4_BASE_DEBUGGER_CAP, l4_bytes_to_mwords(), l4_ipc_call(), L4_IPC_NEVER, l4_msgtag(), L4_PROTO_DEBUGGER, l4_utcb(), and l4_msg_regs_t::mr.

Referenced by fiasco_tbuf_log_3val().

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

◆ __kdebug_op()

l4_msgtag_t __kdebug_op ( unsigned  op)
inline

Invoke a nullary operation on the base debugger capability.

Parameters
opNullary operation code from l4_kdebug_ops_t or a value above 0x200 used by the kernel trace buffer implementation (__ktrace-impl.h).
Return values
Messagetag returned from the IPC on the base debugger capability.

Definition at line 66 of file kdebug.h.

References L4_BASE_DEBUGGER_CAP, l4_ipc_call(), L4_IPC_NEVER, l4_msgtag(), L4_PROTO_DEBUGGER, l4_utcb(), and l4_msg_regs_t::mr.

Referenced by fiasco_tbuf_clear(), and fiasco_tbuf_dump().

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

◆ __kdebug_op_1()

l4_msgtag_t __kdebug_op_1 ( unsigned  op,
l4_mword_t  val 
)
inline

Invoke an unary operation on the base debugger capability.

Parameters
opUnary operation code from l4_kdebug_ops_t or a value above 0x200 used by the kernel trace buffer implementation (__ktrace-impl.h).
valMachine word argument to the unary operation.
Return values
Messagetag returned from the IPC on the base debugger capability.

Definition at line 174 of file kdebug.h.

References L4_BASE_DEBUGGER_CAP, l4_ipc_call(), L4_IPC_NEVER, l4_msgtag(), L4_PROTO_DEBUGGER, l4_utcb(), and l4_msg_regs_t::mr.

Referenced by outchar(), outdec(), outhex12(), outhex16(), outhex20(), outhex32(), outhex64(), outhex8(), and outumword().

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

◆ __kdebug_text()

l4_msgtag_t __kdebug_text ( unsigned  op,
char const *  text,
unsigned  len 
)
inline

Invoke a text output operation on the base debugger capability.

Parameters
opText output operation code from l4_kdebug_ops_t or a value above 0x200 used by the kernel trace buffer implementation (__ktrace-impl.h).
textOutput string.
lenLength of the output string. The maximum length is limited to L4_UTCB_GENERIC_DATA_SIZE - 2 machine words. Output strings longer than this limit will be cropped.
Return values
Messagetag returned from the IPC on the base debugger capability.

Definition at line 96 of file kdebug.h.

References L4_BASE_DEBUGGER_CAP, l4_bytes_to_mwords(), l4_ipc_call(), L4_IPC_NEVER, l4_msgtag(), L4_PROTO_DEBUGGER, l4_utcb(), and l4_msg_regs_t::mr.

Referenced by enter_kdebug(), fiasco_tbuf_log(), fiasco_tbuf_log_binary(), and outnstring().

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

◆ enter_kdebug()

void enter_kdebug ( char const *  text)
inline

Enter the kernel debugger.

Parameters
textOptional message displayed by the kernel debugger when entered.

Enter the kernel debugger, if configured. An optional message can be passed to the kernel debugger which is printed upon the entering of the debugger.

Examples
examples/sys/singlestep/main.c.

Definition at line 202 of file kdebug.h.

References __kdebug_text(), L4_BASE_DEBUGGER_CAP, l4_ipc_call(), L4_IPC_NEVER, l4_msgtag(), and L4_PROTO_DEBUGGER.

+ Here is the call graph for this function:

◆ outchar()

void outchar ( char  c)
inline

Output a single character via the kernel debugger.

Parameters
cOutput character.

Definition at line 243 of file kdebug.h.

References __kdebug_op_1().

+ Here is the call graph for this function:

◆ outdec()

void outdec ( l4_mword_t  number)
inline

Output a decimal unsigned machine word via the kernel debugger.

Parameters
numberOutput machine word.

Definition at line 332 of file kdebug.h.

References __kdebug_op_1().

+ Here is the call graph for this function:

◆ outhex12()

void outhex12 ( l4_uint16_t  number)
inline

Output a 12-bit unsigned hexadecimal number via the kernel debugger.

Parameters
numberOutput 12-bit number. Only the 12 LSB bits are used.

Definition at line 312 of file kdebug.h.

References __kdebug_op_1().

+ Here is the call graph for this function:

◆ outhex16()

void outhex16 ( l4_uint16_t  number)
inline

Output a 16-bit unsigned hexadecimal number via the kernel debugger.

Parameters
numberOutput 16-bit number.

Definition at line 302 of file kdebug.h.

References __kdebug_op_1().

+ Here is the call graph for this function:

◆ outhex20()

void outhex20 ( l4_uint32_t  number)
inline

Output a 20-bit unsigned hexadecimal number via the kernel debugger.

Parameters
numberOutput 20-bit number. Only the 20 LSB bits are used.

Definition at line 292 of file kdebug.h.

References __kdebug_op_1().

+ Here is the call graph for this function:

◆ outhex32()

void outhex32 ( l4_uint32_t  number)
inline

Output a 32-bit unsigned hexadecimal number via the kernel debugger.

Parameters
numberOutput 32-bit number.

Definition at line 282 of file kdebug.h.

References __kdebug_op_1().

+ Here is the call graph for this function:

◆ outhex64()

void outhex64 ( l4_uint64_t  number)
inline

Output a 64-bit unsigned hexadecimal number via the kernel debugger.

Parameters
numberOutput 64-bit number.

The two 32-bit halves are printed non-atomically.

Definition at line 271 of file kdebug.h.

References __kdebug_op_1().

+ Here is the call graph for this function:

◆ outhex8()

void outhex8 ( l4_uint8_t  number)
inline

Output an 8-bit unsigned hexadecimal number via the kernel debugger.

Parameters
numberOutput 8-bit number.

Definition at line 322 of file kdebug.h.

References __kdebug_op_1().

+ Here is the call graph for this function:

◆ outnstring()

void outnstring ( char const *  text,
unsigned  len 
)
inline

Output a fixed-length string via the kernel debugger.

Parameters
textBeginning of the output string.
lenLength of the output string. The maximum length is limited to L4_UTCB_GENERIC_DATA_SIZE - 2 machine words. Output strings longer than this limit will be cropped.

Definition at line 224 of file kdebug.h.

References __kdebug_text().

Referenced by outstring().

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

◆ outstring()

void outstring ( char const *  text)
inline

Output a string via the kernel debugger.

Parameters
textBeginning of the output string. The maximum length of the output string is limited to L4_UTCB_GENERIC_DATA_SIZE - 2 machine words. Output strings longer than this limit will be cropped.

Definition at line 235 of file kdebug.h.

References outnstring().

+ Here is the call graph for this function:

◆ outumword()

void outumword ( l4_umword_t  number)
inline

Output a hexadecimal unsigned machine word via the kernel debugger.

Parameters
numberOutput machine word.

If the machine word is 64 bits long, it is printed non-atomically as two 32-bit numbers.

Definition at line 256 of file kdebug.h.

References __kdebug_op_1().

+ Here is the call graph for this function: