Hi Peter,
it's a good idea to post an explanation here (might be someone will edit
this into a page in our wiki).
1. Traditional DPRINT debug printing ("old way"): All source code files have
an #define NDEBUG atop of them, a developer could get a detailed tracing of
function calls inside this src code file. DPRINT1()s are used when that code
branch must always notify a user / developer (examples are: critical error,
not fully implemented branch with a reminder to finish implementation, and
any other kind of a situation which occurs rarely and may have a severe
impact on a system).
2. "Wine-way" of debug print messages. The printing is done using three
macros: TRACE(), WARN(), ERR(). Respectively, TRACE() is the most frequently
printed, WARN() is less frequently, and ERR() is an equivalent of a
DPRINT1() - always printed, in error situations.
In order to enable TRACE() and WARN() debug prints, one must add a #define
YDEBUG to the respective place inside an interesting source code file. (Wine
has a concept of debug channels, which can be turned on and off, however
ReactOS for now does not implement this).
3. Other ways exist, specific for drivers / applications (e.g. for miniport
/ port / class drivers, client drivers usually use their class's driver's
debug print routine, a custom one, having custom severities levels).
4. Newer ways of debug printing (kernel-specific, look for debug channels in
windows 2003, debug printing in Vista, -- OSR magazine had a nice article
about these).
WBR,
Aleksey Bragin.
----- Original Message -----
From: <breakoutbox(a)web.de>
To: <Ros-dev(a)reactos.org>
Sent: Thursday, April 19, 2007 4:21 PM
Subject: [ros-dev] DbgPrint() - DPRINT() - DPRINT1()
Hello,
can please anybody explain me how You want DbgPrint() - DPRINT() -
DPRINT1() to be used ?
I found a lot of DPRINT() _for_example_ in "win32/in32k/objects/dc.c" but
it is not shown on serial debug (?)
(and also SOME ot these DPRINT1() .. )
1)
If I use DPRINT1() instead, it is always shown.
If I use DbgPrint() instead, it is only shown when #DEBUG is defined in
the file + in *.rbuild
But what's the sense of DPRINT() then ?
=>
2)
2nd stage: on installing from BootCD I can see serial debug only when I
select DEBUG from startup options.
Is this DPRINT1() suppressed when I DON'T select DEBUG ?
3)
Why is there not one DbgPrint() in "win32/in32k/objects/dc.c" (and also in
other files in /DRIVER/ and /NTOSKRNL/ ..) ?
I now have to change every serial debug output to be able to see anything
.. ( if You don't explain me ... ;-) )
Best regards,
Peter.