Talk:L4Re error handling
From TUDOS-Wiki
DRAFT
- interresting files ./l4sys/include/err.h, ./l4util/include/assert.h, ./l4re/include/error_helper, ./l4sys/lib/src/errtostr.c, ./cxx/lib/util/src/ipc_error_str.cc, ./cxx/lib/base/include/exceptions, ./cxx/lib/base/include/std_exc_io, ./moe/server/src/exception.cc, ./moe/server/src/exception.h, many files containing "debug" (but Kernel Debugger is not relevant here, I think)
- BD: JDB, the kernel debugger, could be relevant in so far that you could mention enter_kdebug().
- common types which can represent error conditions: l4_cap_idx_t, Cap, l4_msgtag_t
- l4_cap_idx_t and Cap are very similar, cause Cap is a wrapper for l4_cap_idx_t
- can be invalid
- check l4_cap_idx_t with l4_is_invalid_cap and l4_is_valid_cap
- check Cap with L4::Cap_base::is_valid
- TODO where and when do we use L4::Cap_base::validate?
- how to handle? log! also: don't support the feature which needs access to this capability... generally this means end the task
- l4_msgtag_t
- some error conditions
- many methods to check for more or less specific errors
- TODO talk to someone, grep code
- Message Tag l4_msgtag_has_error and more
- Error handling l4_ipc_error, l4_error and more specific ones, most specific seams to be l4_ipc_error_code
- how to handle: log! depends on specific error. often task configuration error, so end task or don't provide feature
- C++ Exceptions
- chksys for l4_msgtag_t and long
- chkcap for Cap<T>
- throw some L4::Base_exception
- has a method returning a "human readable" string! L4::Base_exception::str
- exceptions can be printed with std::ostream
- you can put try { } catch(e) { std::cerr << e } in your thread functions like main
- ./l4sys/lib/src/errtostr.c
- l4sys_errtostr(long) for L4_E* and L4_IPC_* constants
- ./cxx/lib/util/src/ipc_error_str.cc
- TODO too funny
- TODO grep for usage