lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Debug code


From: Marc Boucher
Subject: Re: [lwip-users] Debug code
Date: Wed, 26 Feb 2003 08:44:49 -0500
User-agent: Mutt/1.5.1i

Hi,

Zschocke, Florian wrote:
>
>In the lwIP sources I find lots of constructs like this:
>
>#if SOCKETS_DEBUG
> DEBUGF(SOCKETS_DEBUG, ("lwip_bind(%d, addr=", s));
> ip_addr_debug_print(&local_addr);
> DEBUGF(SOCKETS_DEBUG, (" port=%u)\n", ntohs(local_port)));
>#endif

Btw such debug contructs are also very problematic on systems where multiple
tasks simultaneously generate debug output, since other messages can end up
being inserted between the multiple print calls resulting in mixed /
confusing lines.

Better would be to print everything at once using a
"lwip_bind(%d, addr=%s port=%u)\n" format string with some inet_addr()-like
function (minus re-entrancy issues) or macro/token to handle IP address
formatting.

Marc





reply via email to

[Prev in Thread] Current Thread [Next in Thread]