L4Re - L4 Runtime Environment
L4::Debugger Class Reference

C++ kernel debugger API. More...

+ Inheritance diagram for L4::Debugger:
+ Collaboration diagram for L4::Debugger:

Public Member Functions

l4_msgtag_t set_object_name (const char *name, l4_utcb_t *utcb=l4_utcb()) throw ()
 Set the name of a kernel object. More...
 
unsigned long global_id (l4_utcb_t *utcb=l4_utcb()) throw ()
 Get the globally unique ID of the object behind a capability. More...
 
unsigned long kobj_to_id (l4_addr_t kobjp, l4_utcb_t *utcb=l4_utcb()) throw ()
 Get the globally unique ID of the object behind the kobject pointer. More...
 
int query_log_typeid (const char *name, unsigned idx, l4_utcb_t *utcb=l4_utcb()) throw ()
 Query the log-id for a log type. More...
 
int query_log_name (unsigned idx, char *name, unsigned namelen, char *shortname, unsigned shortnamelen, l4_utcb_t *utcb=l4_utcb()) throw ()
 Query the name of a log type given the ID. More...
 
l4_msgtag_t switch_log (const char *name, unsigned on_off, l4_utcb_t *utcb=l4_utcb()) throw ()
 Set or unset log. More...
 
l4_msgtag_t get_object_name (unsigned id, char *name, unsigned size, l4_utcb_t *utcb=l4_utcb()) throw ()
 Get name of object with Id id. More...
 
- Public Member Functions inherited from L4::Kobject
l4_msgtag_t dec_refcnt (l4_mword_t diff, l4_utcb_t *utcb=l4_utcb())
 Decrement the in kernel reference counter for the object. More...
 

Additional Inherited Members

- Protected Types inherited from L4::Kobject_t< Debugger, Kobject, L4_PROTO_DEBUGGER >
typedef Debugger Class
 The target interface type (inheriting from Kobject_t)
 
typedef Typeid::Iface< PROTO, Debugger__Iface
 The interface description for the derived class.
 
typedef Typeid::Merge_list< Typeid::Iface_list< __Iface >, typename Kobject ::__Iface_list > __Iface_list
 The list of all RPC interfaces provided directly or through inheritance.
 
- Protected Member Functions inherited from L4::Kobject_t< Debugger, Kobject, L4_PROTO_DEBUGGER >
L4::Cap< Classc () const
 Get the capability to ourselves.
 
- Protected Member Functions inherited from L4::Kobject
l4_cap_idx_t cap () const throw ()
 Return capability selector. More...
 
- Static Protected Member Functions inherited from L4::Kobject_t< Debugger, Kobject, L4_PROTO_DEBUGGER >
static void __check_protocols__ ()
 Helper to check for protocol conflicts.
 

Detailed Description

C++ kernel debugger API.

Attention
This API is subject to change! Do not rely on it in production code.

This API is to be used for debugging exclusively.

This is the API for accessing kernel-debugger functionality from user-level programs. Specifically, it provides functionality to enrich the kernel debugger with insights into the program. The purpose is to facilitate debugging with the kernel debugger. For instance, a developer might choose to name the threads of her program so that she can find them in the kernel debugger thread list.

This API interacts with a kernel object that interfaces with the kernel debugger, the jdb-kernel object. The jdb-kernel object is fix and only available when the kernel debugger is built into the microkernel. The developer needs to pass the capability through to her program.

Include File
#include <l4/sys/debugger>

Definition at line 53 of file debugger.

Member Function Documentation

◆ get_object_name()

l4_msgtag_t L4::Debugger::get_object_name ( unsigned  id,
char *  name,
unsigned  size,
l4_utcb_t utcb = l4_utcb() 
)
throw (
)
inline

Get name of object with Id id.

Parameters
idId of the object whose name is asked.
[out]nameBuffer to copy the name into. The buffer must be allocated by the caller.
sizeLength of the name buffer.
utcbThe UTCB to use for the operation.
Returns
Syscall return tag

Definition at line 159 of file debugger.

◆ global_id()

unsigned long L4::Debugger::global_id ( l4_utcb_t utcb = l4_utcb())
throw (
)
inline

Get the globally unique ID of the object behind a capability.

Parameters
utcbThe UTCB to use for the operation.
Return values
~0ULThe capability is invalid.
>=0The global debugger id.

Definition at line 82 of file debugger.

◆ kobj_to_id()

unsigned long L4::Debugger::kobj_to_id ( l4_addr_t  kobjp,
l4_utcb_t utcb = l4_utcb() 
)
throw (
)
inline

Get the globally unique ID of the object behind the kobject pointer.

Parameters
kobjpKobject pointer
utcbThe UTCB to use for the operation.
Return values
~0ULThe capability or the Kobject pointer are invalid.
>=0The globally unique id.

Definition at line 94 of file debugger.

◆ query_log_name()

int L4::Debugger::query_log_name ( unsigned  idx,
char *  name,
unsigned  namelen,
char *  shortname,
unsigned  shortnamelen,
l4_utcb_t utcb = l4_utcb() 
)
throw (
)
inline

Query the name of a log type given the ID.

Parameters
idxID to query.
[out]nameBuffer to copy name to. The buffer must be allocated by the caller.
namelenBuffer length of name.
[out]shortnameBuffer to copy shortname to. The buffer must be allocated by the caller.
shortnamelenBuffer length of shortname.
utcbThe UTCB to use for the operation.
Return values
0Success
<0Error

Definition at line 127 of file debugger.

◆ query_log_typeid()

int L4::Debugger::query_log_typeid ( const char *  name,
unsigned  idx,
l4_utcb_t utcb = l4_utcb() 
)
throw (
)
inline

Query the log-id for a log type.

Parameters
nameName to query for.
idxIdx to start searching, start with 0
utcbThe UTCB to use for the operation.
Return values
>=0Id
<0Error

Definition at line 108 of file debugger.

◆ set_object_name()

l4_msgtag_t L4::Debugger::set_object_name ( const char *  name,
l4_utcb_t utcb = l4_utcb() 
)
throw (
)
inline

Set the name of a kernel object.

Parameters
nameName
utcbThe UTCB to use for the operation.
Returns
System call return tag.

Definition at line 70 of file debugger.

◆ switch_log()

l4_msgtag_t L4::Debugger::switch_log ( const char *  name,
unsigned  on_off,
l4_utcb_t utcb = l4_utcb() 
)
throw (
)
inline

Set or unset log.

Parameters
nameName of the log type.
on_off1: turn log on, 0: turn log off
utcbThe UTCB to use for the operation.
Returns
Syscall return tag

Definition at line 144 of file debugger.


The documentation for this class was generated from the following file: