Coding in K42
Useful general information to do with K42 development
Coding Style
Information about K42's coding style is available at CodingStyle and in the source tree at doc/Style.sgml
Error Numbers
Copied from: lib/libc/sys/SysStatus.H
- Sprinkled around the code there are many lines like: return _SERROR(2463, 0, ENOSYS); The following describes how to generate the error codes Basic Kitchawan status/error type, Errors are divided into three parts
ErrorCode: a unique 15 bit number used for reporting specific errors to os developers (for classes, this is a number that uniquely identifies the class which generated the error)
ClassCode: a code specific to the class invoked possibly interpreted by caller, and
GenCode: a generic error code which can be set to any of the errors in sys/errno.h
Unique ErrorCode numbers are generated using the tool nextErrNumber. If a call is made on a deleted object, the reserved ClassCode of 0xFF is returned.
The .gdbinit mentioned in DebuggingK42 defines "serror" to separate the parts.
You need to be logged into a Watson machine to run the nextErrNumber tool.
'Is there a tool for mapping error numbers to where it was generated?'
(Answer from DilmaDaSilva: I use grep; it's not ideal, but it's still manageable.)
