打开LWIP_DEBUG的打印信息调试

在lwip 2.1.2的版本,打开的debug 调试的步骤:
1.在debug.h 文件中找到debug打印的定义
打开LWIP_DEBUG的打印信息调试
文章图片

默认LWIP_DEBUG这个宏没有定义,
2.在lwipopt.h 文件中或者其他文件定义 一下LWIP_DEBUG这个宏,
打开LWIP_DEBUG的打印信息调试
文章图片

3.在opt.h 中可以打开各种宏的调试信息,
/*
---------------------------------------
---------- Debugging options ----------
---------------------------------------
*/
/**
* @defgroup lwip_opts_debugmsg Debug messages
* @ingroup lwip_opts_debug
* @{
*/
/**
* LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is
* compared against this value. If it is smaller, then debugging
* messages are written.
* @see debugging_levels
*/
#if !defined LWIP_DBG_MIN_LEVEL || defined __DOXYGEN__
#define LWIP_DBG_MIN_LEVELLWIP_DBG_LEVEL_ALL
#endif
/**
* LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable
* debug messages of certain types.
* @see debugging_levels
*/
#if !defined LWIP_DBG_TYPES_ON || defined __DOXYGEN__
#define LWIP_DBG_TYPES_ONLWIP_DBG_ON
#endif
/**
* ETHARP_DEBUG: Enable debugging in etharp.c.
*/
#if !defined ETHARP_DEBUG || defined __DOXYGEN__
#define ETHARP_DEBUGLWIP_DBG_ON//LWIP_DBG_OFF
#endif
/**
* NETIF_DEBUG: Enable debugging in netif.c.
*/
#if !defined NETIF_DEBUG || defined __DOXYGEN__
#define NETIF_DEBUGLWIP_DBG_OFF
#endif
/**
* PBUF_DEBUG: Enable debugging in pbuf.c.
*/
#if !defined PBUF_DEBUG || defined __DOXYGEN__
#define PBUF_DEBUGLWIP_DBG_OFF
#endif
/**
* API_LIB_DEBUG: Enable debugging in api_lib.c.
*/
#if !defined API_LIB_DEBUG || defined __DOXYGEN__
#define API_LIB_DEBUGLWIP_DBG_OFF
#endif
/**
* API_MSG_DEBUG: Enable debugging in api_msg.c.
*/
#if !defined API_MSG_DEBUG || defined __DOXYGEN__
#define API_MSG_DEBUGLWIP_DBG_OFF
#endif
/**
* SOCKETS_DEBUG: Enable debugging in sockets.c.
*/
#if !defined SOCKETS_DEBUG || defined __DOXYGEN__
#define SOCKETS_DEBUGLWIP_DBG_OFF
#endif
/**
* ICMP_DEBUG: Enable debugging in icmp.c.
*/
#if !defined ICMP_DEBUG || defined __DOXYGEN__
#define ICMP_DEBUGLWIP_DBG_OFF
#endif
/**
* IGMP_DEBUG: Enable debugging in igmp.c.
*/
#if !defined IGMP_DEBUG || defined __DOXYGEN__
#define IGMP_DEBUGLWIP_DBG_OFF
#endif
/**
* INET_DEBUG: Enable debugging in inet.c.
*/
#if !defined INET_DEBUG || defined __DOXYGEN__
#define INET_DEBUGLWIP_DBG_ON//LWIP_DBG_OFF
#endif
/**
* IP_DEBUG: Enable debugging for IP.
*/
#if !defined IP_DEBUG || defined __DOXYGEN__
#define IP_DEBUGLWIP_DBG_OFF
#endif
/**
* IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass.
*/
#if !defined IP_REASS_DEBUG || defined __DOXYGEN__
#define IP_REASS_DEBUGLWIP_DBG_OFF
#endif
/**
* RAW_DEBUG: Enable debugging in raw.c.
*/
#if !defined RAW_DEBUG || defined __DOXYGEN__
#define RAW_DEBUGLWIP_DBG_OFF
#endif
/**
* MEM_DEBUG: Enable debugging in mem.c.
*/
#if !defined MEM_DEBUG || defined __DOXYGEN__
#define MEM_DEBUGLWIP_DBG_OFF
#endif
/**
* MEMP_DEBUG: Enable debugging in memp.c.
*/
#if !defined MEMP_DEBUG || defined __DOXYGEN__
#define MEMP_DEBUGLWIP_DBG_OFF
#endif
/**
* SYS_DEBUG: Enable debugging in sys.c.
*/
#if !defined SYS_DEBUG || defined __DOXYGEN__
#define SYS_DEBUGLWIP_DBG_OFF
#endif
/**
* TIMERS_DEBUG: Enable debugging in timers.c.
*/
#if !defined TIMERS_DEBUG || defined __DOXYGEN__
#define TIMERS_DEBUGLWIP_DBG_OFF
#endif
/**
* TCP_DEBUG: Enable debugging for TCP.
*/
#if !defined TCP_DEBUG || defined __DOXYGEN__
#define TCP_DEBUGLWIP_DBG_OFF
#endif
/**
* TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug.
*/
#if !defined TCP_INPUT_DEBUG || defined __DOXYGEN__
#define TCP_INPUT_DEBUGLWIP_DBG_OFF
#endif
/**
* TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit.
*/
#if !defined TCP_FR_DEBUG || defined __DOXYGEN__
#define TCP_FR_DEBUGLWIP_DBG_OFF
#endif
/**
* TCP_RTO_DEBUG: Enable debugging in TCP for retransmit
* timeout.
*/
#if !defined TCP_RTO_DEBUG || defined __DOXYGEN__
#define TCP_RTO_DEBUGLWIP_DBG_OFF
#endif
/**
* TCP_CWND_DEBUG: Enable debugging for TCP congestion window.
*/
#if !defined TCP_CWND_DEBUG || defined __DOXYGEN__
#define TCP_CWND_DEBUGLWIP_DBG_OFF
#endif
/**
* TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating.
*/
#if !defined TCP_WND_DEBUG || defined __DOXYGEN__
#define TCP_WND_DEBUGLWIP_DBG_OFF
#endif
/**
* TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions.
*/
#if !defined TCP_OUTPUT_DEBUG || defined __DOXYGEN__
#define TCP_OUTPUT_DEBUGLWIP_DBG_OFF
#endif
/**
* TCP_RST_DEBUG: Enable debugging for TCP with the RST message.
*/
#if !defined TCP_RST_DEBUG || defined __DOXYGEN__
#define TCP_RST_DEBUGLWIP_DBG_OFF
#endif
/**
* TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths.
*/
#if !defined TCP_QLEN_DEBUG || defined __DOXYGEN__
#define TCP_QLEN_DEBUGLWIP_DBG_OFF
#endif
/**
* UDP_DEBUG: Enable debugging in UDP.
*/
#if !defined UDP_DEBUG || defined __DOXYGEN__
#define UDP_DEBUGLWIP_DBG_OFF
#endif
/**
* TCPIP_DEBUG: Enable debugging in tcpip.c.
*/
#if !defined TCPIP_DEBUG || defined __DOXYGEN__
#define TCPIP_DEBUGLWIP_DBG_OFF
#endif
/**
* SLIP_DEBUG: Enable debugging in slipif.c.
*/
#if !defined SLIP_DEBUG || defined __DOXYGEN__
#define SLIP_DEBUGLWIP_DBG_OFF
#endif
/**
* DHCP_DEBUG: Enable debugging in dhcp.c.
*/
#if !defined DHCP_DEBUG || defined __DOXYGEN__
#define DHCP_DEBUGLWIP_DBG_OFF
#endif
/**
* AUTOIP_DEBUG: Enable debugging in autoip.c.
*/
#if !defined AUTOIP_DEBUG || defined __DOXYGEN__
#define AUTOIP_DEBUGLWIP_DBG_OFF
#endif
/**
* DNS_DEBUG: Enable debugging for DNS.
*/
#if !defined DNS_DEBUG || defined __DOXYGEN__
#define DNS_DEBUGLWIP_DBG_OFF
#endif
/**
* IP6_DEBUG: Enable debugging for IPv6.
*/
#if !defined IP6_DEBUG || defined __DOXYGEN__
#define IP6_DEBUGLWIP_DBG_OFF
#endif
【打开LWIP_DEBUG的打印信息调试】/**
* DHCP6_DEBUG: Enable debugging in dhcp6.c.
*/
#if !defined DHCP6_DEBUG || defined __DOXYGEN__
#define DHCP6_DEBUGLWIP_DBG_OFF
#endif

    推荐阅读