mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-07 15:04:39 +08:00
Add debugging options to documentation
This commit is contained in:
parent
e3c2b8a339
commit
a3876314b7
@ -40,18 +40,24 @@
|
|||||||
#include "lwip/arch.h"
|
#include "lwip/arch.h"
|
||||||
#include "lwip/opt.h"
|
#include "lwip/opt.h"
|
||||||
|
|
||||||
/** lower two bits indicate debug level
|
/**
|
||||||
* - 0 all
|
* @defgroup debugging Debugging
|
||||||
* - 1 warning
|
* @ingroup lwip
|
||||||
* - 2 serious
|
* @{
|
||||||
* - 3 severe
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** Debug level: ALL messages*/
|
||||||
#define LWIP_DBG_LEVEL_ALL 0x00
|
#define LWIP_DBG_LEVEL_ALL 0x00
|
||||||
#define LWIP_DBG_LEVEL_OFF LWIP_DBG_LEVEL_ALL /* compatibility define only */
|
/** Debug level: Warnings. bad checksums, dropped packets, ... */
|
||||||
#define LWIP_DBG_LEVEL_WARNING 0x01 /* bad checksums, dropped packets, ... */
|
#define LWIP_DBG_LEVEL_WARNING 0x01
|
||||||
#define LWIP_DBG_LEVEL_SERIOUS 0x02 /* memory allocation failures, ... */
|
/** Debug level: Serious. memory allocation failures, ... */
|
||||||
|
#define LWIP_DBG_LEVEL_SERIOUS 0x02
|
||||||
|
/** Debug level: Severe */
|
||||||
#define LWIP_DBG_LEVEL_SEVERE 0x03
|
#define LWIP_DBG_LEVEL_SEVERE 0x03
|
||||||
|
|
||||||
#define LWIP_DBG_MASK_LEVEL 0x03
|
#define LWIP_DBG_MASK_LEVEL 0x03
|
||||||
|
/* compatibility define only */
|
||||||
|
#define LWIP_DBG_LEVEL_OFF LWIP_DBG_LEVEL_ALL
|
||||||
|
|
||||||
/** flag for LWIP_DEBUGF to enable that debug message */
|
/** flag for LWIP_DEBUGF to enable that debug message */
|
||||||
#define LWIP_DBG_ON 0x80U
|
#define LWIP_DBG_ON 0x80U
|
||||||
@ -68,9 +74,14 @@
|
|||||||
#define LWIP_DBG_HALT 0x08U
|
#define LWIP_DBG_HALT 0x08U
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LWIP_NOASSERT: Disable LWIP_ASSERT checks.
|
* LWIP_NOASSERT: Disable LWIP_ASSERT checks:
|
||||||
* -- To disable assertions define LWIP_NOASSERT in arch/cc.h.
|
* To disable assertions define LWIP_NOASSERT in arch/cc.h.
|
||||||
*/
|
*/
|
||||||
|
#ifdef __DOXYGEN__
|
||||||
|
#define LWIP_NOASSERT
|
||||||
|
#undef LWIP_NOASSERT
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef LWIP_NOASSERT
|
#ifndef LWIP_NOASSERT
|
||||||
#define LWIP_ASSERT(message, assertion) do { if (!(assertion)) { \
|
#define LWIP_ASSERT(message, assertion) do { if (!(assertion)) { \
|
||||||
LWIP_PLATFORM_ASSERT(message); }} while(0)
|
LWIP_PLATFORM_ASSERT(message); }} while(0)
|
||||||
@ -81,7 +92,6 @@
|
|||||||
#define LWIP_ASSERT(message, assertion)
|
#define LWIP_ASSERT(message, assertion)
|
||||||
#endif /* LWIP_NOASSERT */
|
#endif /* LWIP_NOASSERT */
|
||||||
|
|
||||||
/** if "expression" isn't true, then print "message" and execute "handler" expression */
|
|
||||||
#ifndef LWIP_ERROR
|
#ifndef LWIP_ERROR
|
||||||
#ifndef LWIP_NOASSERT
|
#ifndef LWIP_NOASSERT
|
||||||
#define LWIP_PLATFORM_ERROR(message) LWIP_PLATFORM_ASSERT(message)
|
#define LWIP_PLATFORM_ERROR(message) LWIP_PLATFORM_ASSERT(message)
|
||||||
@ -91,17 +101,24 @@
|
|||||||
#define LWIP_PLATFORM_ERROR(message)
|
#define LWIP_PLATFORM_ERROR(message)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* if "expression" isn't true, then print "message" and execute "handler" expression */
|
||||||
#define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \
|
#define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \
|
||||||
LWIP_PLATFORM_ERROR(message); handler;}} while(0)
|
LWIP_PLATFORM_ERROR(message); handler;}} while(0)
|
||||||
#endif /* LWIP_ERROR */
|
#endif /* LWIP_ERROR */
|
||||||
|
|
||||||
|
/** Enable debug message printing, but only if debug message type is enabled
|
||||||
|
* AND is of correct type AND is at least LWIP_DBG_LEVEL.
|
||||||
|
* e.g. \#define LWIP_DEBUG (LWIP_DBG_ON | LWIP_DBG_LEVEL_ALL | LWIP_DBG_TRACE)
|
||||||
|
*/
|
||||||
|
#ifdef __DOXYGEN__
|
||||||
|
#define LWIP_DEBUG
|
||||||
|
#undef LWIP_DEBUG
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef LWIP_DEBUG
|
#ifdef LWIP_DEBUG
|
||||||
#ifndef LWIP_PLATFORM_DIAG
|
#ifndef LWIP_PLATFORM_DIAG
|
||||||
#error "If you want to use LWIP_DEBUG, LWIP_PLATFORM_DIAG(message) needs to be defined in your arch/cc.h"
|
#error "If you want to use LWIP_DEBUG, LWIP_PLATFORM_DIAG(message) needs to be defined in your arch/cc.h"
|
||||||
#endif
|
#endif
|
||||||
/** print debug message only if debug message type is enabled...
|
|
||||||
* AND is of correct type AND is at least LWIP_DBG_LEVEL
|
|
||||||
*/
|
|
||||||
#define LWIP_DEBUGF(debug, message) do { \
|
#define LWIP_DEBUGF(debug, message) do { \
|
||||||
if ( \
|
if ( \
|
||||||
((debug) & LWIP_DBG_ON) && \
|
((debug) & LWIP_DBG_ON) && \
|
||||||
@ -118,5 +135,8 @@
|
|||||||
#define LWIP_DEBUGF(debug, message)
|
#define LWIP_DEBUGF(debug, message)
|
||||||
#endif /* LWIP_DEBUG */
|
#endif /* LWIP_DEBUG */
|
||||||
|
|
||||||
#endif /* LWIP_HDR_DEBUG_H */
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* LWIP_HDR_DEBUG_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user