The DBG_ENABLE() and DBG_DISABLE() macros currently affect the debug level of all objects that were built with debugging enabled. This is undesirable, since it is common to use different debug levels in each object. Make the debug level mask a per-object variable. DBG_ENABLE() and DBG_DISABLE() now control only the debug level for the containing object (which is consistent with the intended usage across the existing codebase). DBG_ENABLE_OBJECT() and DBG_DISABLE_OBJECT() may be used to control the debug level for a specified object. For example: // Enable DBG() messages from tcpip.c DBG_ENABLE_OBJECT ( tcpip, DBGLVL_LOG ); Note that the existence of debug messages continues to be gated by the DEBUG=... list specified on the build command line. If an object was built without the relevant debug level, then DBG_ENABLE_OBJECT() will have no effect on that object at runtime (other than to explicitly drag in the object via a symbol reference). Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
|
||
285 |
|
285 |
|
286 |
|
286 |
|
287 |
|
287 |
|
|
288 |
|
|
|
289 |
|
|
|
290 |
|
|
|
291 |
|
|
|
292 |
|
|
|
293 |
|
|
|
294 |
|
|
|
295 |
|
|
|
296 |
|
|
|
297 |
|
|
288 |
|
298 |
|
289 |
|
|
|
290 |
|
|
|
|
299 |
|
|
291 |
|
300 |
|
292 |
|
|
|
|
301 |
|
|
293 |
|
302 |
|
294 |
|
303 |
|
295 |
|
|
|
|
304 |
|
|
296 |
|
305 |
|
297 |
|
306 |
|
298 |
|
307 |
|