Something like OutputDebugString

I feel so embarrassed but I’ve been looking and looking and can’t find the
answer to what should be an easy question.

I’m looking for something like OutputDebugString and/or KdPrint for user
mode.

That is, I want my user mode application to be able to do the equivalent of
a KdPrint so that I can see some output on the WinDbg command window. As
you probably know, OutputDebugString will send debugging output to the
application debugger rather than the kernel mode debugger.

As you’ve probably guessed, I’m running both the VC++ IDE and WinDbg in
order to debug a rather complex system.

I’ve toyed with sending an IOCTL to my own driver in order to simulate this
but is there a better way?

Ralph

DbgPrint()

Enjoy! :slight_smile:
Mat

-----Original Message-----
From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
Sent: Wednesday, July 02, 2003 12:17 PM
To: NT Developers Interest List
Subject: [ntdev] Something like OutputDebugString

I feel so embarrassed but I’ve been looking and looking and can’t find the
answer to what should be an easy question.

I’m looking for something like OutputDebugString and/or KdPrint for user
mode.

That is, I want my user mode application to be able to do the equivalent of
a KdPrint so that I can see some output on the WinDbg command window. As
you probably know, OutputDebugString will send debugging output to the
application debugger rather than the kernel mode debugger.

As you’ve probably guessed, I’m running both the VC++ IDE and WinDbg in
order to debug a rather complex system.

I’ve toyed with sending an IOCTL to my own driver in order to simulate this
but is there a better way?

Ralph


You are currently subscribed to ntdev as: xxxxx@guillemot.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Dear Mat:

From http://www.osr.com/ddk/ddtools/debugfns_9ecz.htm:


Only kernel-mode drivers can call the DbgPrint routine.


I find no other documentation for DbgPrint. I can’t find any SDK-level
headers that seem to declare DbgPrint in any way that I can link with.

What am I missing?

Ralph

On Wed, 2 Jul 2003 12:25:51 -0400 , you wrote:

DbgPrint()

Enjoy! :slight_smile:
Mat

-----Original Message-----
From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
Sent: Wednesday, July 02, 2003 12:17 PM
To: NT Developers Interest List
Subject: [ntdev] Something like OutputDebugString

I feel so embarrassed but I’ve been looking and looking and can’t find the
answer to what should be an easy question.

I’m looking for something like OutputDebugString and/or KdPrint for user
mode.

That is, I want my user mode application to be able to do the equivalent of
a KdPrint so that I can see some output on the WinDbg command window. As
you probably know, OutputDebugString will send debugging output to the
application debugger rather than the kernel mode debugger.

As you’ve probably guessed, I’m running both the VC++ IDE and WinDbg in
order to debug a rather complex system.

I’ve toyed with sending an IOCTL to my own driver in order to simulate this
but is there a better way?

Ralph


You are currently subscribed to ntdev as: xxxxx@guillemot.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@dos32.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Ralph,
If you do not run VC++ IDE, OutputDebugString displays the
output in WinDBG. I have never used windbg and VC++ IDE at the same
time, so I cannot say what happens in this scenario.

-Srin.

-----Original Message-----
From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
Sent: Wednesday, July 02, 2003 10:31 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Something like OutputDebugString

Dear Mat:

From http://www.osr.com/ddk/ddtools/debugfns_9ecz.htm:


Only kernel-mode drivers can call the DbgPrint routine.


I find no other documentation for DbgPrint. I can’t find any
SDK-level
headers that seem to declare DbgPrint in any way that I can link with.

What am I missing?

Ralph

On Wed, 2 Jul 2003 12:25:51 -0400 , you wrote:

>DbgPrint()
>
>Enjoy! :slight_smile:
>Mat
>
>-----Original Message-----
>From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
>Sent: Wednesday, July 02, 2003 12:17 PM
>To: NT Developers Interest List
>Subject: [ntdev] Something like OutputDebugString
>
>I feel so embarrassed but I’ve been looking and looking and can’t
find
the
>answer to what should be an easy question.
>
>I’m looking for something like OutputDebugString and/or KdPrint for
user
>mode.
>
>That is, I want my user mode application to be able to do the
equivalent
of
>a KdPrint so that I can see some output on the WinDbg command window.
As
>you probably know, OutputDebugString will send debugging output to
the
>application debugger rather than the kernel mode debugger.
>
>As you’ve probably guessed, I’m running both the VC++ IDE and WinDbg
in
>order to debug a rather complex system.
>
>
>I’ve toyed with sending an IOCTL to my own driver in order to
simulate
this
>but is there a better way?
>
>Ralph
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@guillemot.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@dos32.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@nai.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Sorry, I guess I read too fast! embarrassing.

Well, OutputDebugString() should work, doesn’t it?

Mat

-----Original Message-----
From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
Sent: Wednesday, July 02, 2003 1:31 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Something like OutputDebugString

Dear Mat:

From http://www.osr.com/ddk/ddtools/debugfns_9ecz.htm:


Only kernel-mode drivers can call the DbgPrint routine.


I find no other documentation for DbgPrint. I can’t find any SDK-level
headers that seem to declare DbgPrint in any way that I can link with.

What am I missing?

Ralph

On Wed, 2 Jul 2003 12:25:51 -0400 , you wrote:

DbgPrint()

Enjoy! :slight_smile:
Mat

-----Original Message-----
From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
Sent: Wednesday, July 02, 2003 12:17 PM
To: NT Developers Interest List
Subject: [ntdev] Something like OutputDebugString

I feel so embarrassed but I’ve been looking and looking and can’t find the
answer to what should be an easy question.

I’m looking for something like OutputDebugString and/or KdPrint for user
mode.

That is, I want my user mode application to be able to do the equivalent of
a KdPrint so that I can see some output on the WinDbg command window. As
you probably know, OutputDebugString will send debugging output to the
application debugger rather than the kernel mode debugger.

As you’ve probably guessed, I’m running both the VC++ IDE and WinDbg in
order to debug a rather complex system.

I’ve toyed with sending an IOCTL to my own driver in order to simulate this
but is there a better way?

Ralph


You are currently subscribed to ntdev as: xxxxx@guillemot.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@dos32.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@guillemot.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

OutputDebugString works if you don’t have an active application debugger. In
that case if there is an active kernel debugger the output will appear on
the debugger console. If you have an active application debugger you are out
of luck. Try using timestamps to correlate activity.

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
Sent: Wednesday, July 02, 2003 1:31 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Something like OutputDebugString

Dear Mat:

From http://www.osr.com/ddk/ddtools/debugfns_9ecz.htm:


Only kernel-mode drivers can call the DbgPrint routine.


I find no other documentation for DbgPrint. I can’t find any SDK-level
headers that seem to declare DbgPrint in any way that I can link with.

What am I missing?

Ralph

On Wed, 2 Jul 2003 12:25:51 -0400 , you wrote:

DbgPrint()

Enjoy! :slight_smile:
Mat

-----Original Message-----
From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
Sent: Wednesday, July 02, 2003 12:17 PM
To: NT Developers Interest List
Subject: [ntdev] Something like OutputDebugString

I feel so embarrassed but I’ve been looking and looking and can’t find
the answer to what should be an easy question.

I’m looking for something like OutputDebugString and/or KdPrint for
user mode.

That is, I want my user mode application to be able to do the
equivalent of a KdPrint so that I can see some output on the WinDbg
command window. As you probably know, OutputDebugString will send
debugging output to the application debugger rather than the kernel
mode debugger.

As you’ve probably guessed, I’m running both the VC++ IDE and WinDbg in
order to debug a rather complex system.

I’ve toyed with sending an IOCTL to my own driver in order to simulate
this but is there a better way?

Ralph


You are currently subscribed to ntdev as: xxxxx@guillemot.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@dos32.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

Is there any special reason why you need to see Ring 3 messages in Windbg ?
It’s much easier to debug the app from the VC++ debugger.

Alberto.

-----Original Message-----
From: xxxxx@NAI.com [mailto:xxxxx@NAI.com]
Sent: Wednesday, July 02, 2003 1:36 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Something like OutputDebugString

Ralph,
If you do not run VC++ IDE, OutputDebugString displays the
output in WinDBG. I have never used windbg and VC++ IDE at the same
time, so I cannot say what happens in this scenario.

-Srin.

-----Original Message-----
From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
Sent: Wednesday, July 02, 2003 10:31 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Something like OutputDebugString

Dear Mat:

From http://www.osr.com/ddk/ddtools/debugfns_9ecz.htm:


Only kernel-mode drivers can call the DbgPrint routine.


I find no other documentation for DbgPrint. I can’t find any
SDK-level
headers that seem to declare DbgPrint in any way that I can link with.

What am I missing?

Ralph

On Wed, 2 Jul 2003 12:25:51 -0400 , you wrote:

>DbgPrint()
>
>Enjoy! :slight_smile:
>Mat
>
>-----Original Message-----
>From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
>Sent: Wednesday, July 02, 2003 12:17 PM
>To: NT Developers Interest List
>Subject: [ntdev] Something like OutputDebugString
>
>I feel so embarrassed but I’ve been looking and looking and can’t
find
the
>answer to what should be an easy question.
>
>I’m looking for something like OutputDebugString and/or KdPrint for
user
>mode.
>
>That is, I want my user mode application to be able to do the
equivalent
of
>a KdPrint so that I can see some output on the WinDbg command window.
As
>you probably know, OutputDebugString will send debugging output to
the
>application debugger rather than the kernel mode debugger.
>
>As you’ve probably guessed, I’m running both the VC++ IDE and WinDbg
in
>order to debug a rather complex system.
>
>
>I’ve toyed with sending an IOCTL to my own driver in order to
simulate
this
>but is there a better way?
>
>Ralph
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@guillemot.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@dos32.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@nai.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

Dear Mark:

On Wed, 2 Jul 2003 13:42:09 -0400 , you wrote:

OutputDebugString works if you don’t have an active application debugger. In
that case if there is an active kernel debugger the output will appear on
the debugger console. If you have an active application debugger you are out
of luck. Try using timestamps to correlate activity.

I thought about that but it really doesn’t solve the problem, does it?

Anyway, it sure looks like I’m going to have to home brew some stuff.

Amazing how hard simple things are to do in this environment.

Mark, thanks for your help and definitive answer.

Ralph

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
Sent: Wednesday, July 02, 2003 1:31 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Something like OutputDebugString

Dear Mat:

>From http://www.osr.com/ddk/ddtools/debugfns_9ecz.htm:


Only kernel-mode drivers can call the DbgPrint routine.


I find no other documentation for DbgPrint. I can’t find any SDK-level
headers that seem to declare DbgPrint in any way that I can link with.

What am I missing?

Ralph

On Wed, 2 Jul 2003 12:25:51 -0400 , you wrote:

>DbgPrint()
>
>Enjoy! :slight_smile:
>Mat
>
>-----Original Message-----
>From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
>Sent: Wednesday, July 02, 2003 12:17 PM
>To: NT Developers Interest List
>Subject: [ntdev] Something like OutputDebugString
>
>I feel so embarrassed but I’ve been looking and looking and can’t find
>the answer to what should be an easy question.
>
>I’m looking for something like OutputDebugString and/or KdPrint for
>user mode.
>
>That is, I want my user mode application to be able to do the
>equivalent of a KdPrint so that I can see some output on the WinDbg
>command window. As you probably know, OutputDebugString will send
>debugging output to the application debugger rather than the kernel
>mode debugger.
>
>As you’ve probably guessed, I’m running both the VC++ IDE and WinDbg in
>order to debug a rather complex system.
>
>
>I’ve toyed with sending an IOCTL to my own driver in order to simulate
>this but is there a better way?
>
>Ralph
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@guillemot.com To
>unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@dos32.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@dos32.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Timestamps don’t provide exact correlation but they do provide loose
correlation, which in my experience is generally good enough, if somewhat
painful to collate.

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
Sent: Wednesday, July 02, 2003 3:21 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Something like OutputDebugString

Dear Mark:

On Wed, 2 Jul 2003 13:42:09 -0400 , you wrote:

OutputDebugString works if you don’t have an active application
debugger. In that case if there is an active kernel debugger the output
will appear on the debugger console. If you have an active application
debugger you are out of luck. Try using timestamps to correlate
activity.

I thought about that but it really doesn’t solve the problem, does it?

Anyway, it sure looks like I’m going to have to home brew some stuff.

Amazing how hard simple things are to do in this environment.

Mark, thanks for your help and definitive answer.

Ralph

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
Sent: Wednesday, July 02, 2003 1:31 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Something like OutputDebugString

Dear Mat:

>From http://www.osr.com/ddk/ddtools/debugfns_9ecz.htm:


Only kernel-mode drivers can call the DbgPrint routine.


I find no other documentation for DbgPrint. I can’t find any SDK-level
headers that seem to declare DbgPrint in any way that I can link with.

What am I missing?

Ralph

On Wed, 2 Jul 2003 12:25:51 -0400 , you wrote:

>DbgPrint()
>
>Enjoy! :slight_smile:
>Mat
>
>-----Original Message-----
>From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
>Sent: Wednesday, July 02, 2003 12:17 PM
>To: NT Developers Interest List
>Subject: [ntdev] Something like OutputDebugString
>
>I feel so embarrassed but I’ve been looking and looking and can’t find
>the answer to what should be an easy question.
>
>I’m looking for something like OutputDebugString and/or KdPrint for
>user mode.
>
>That is, I want my user mode application to be able to do the
>equivalent of a KdPrint so that I can see some output on the WinDbg
>command window. As you probably know, OutputDebugString will send
>debugging output to the application debugger rather than the kernel
>mode debugger.
>
>As you’ve probably guessed, I’m running both the VC++ IDE and WinDbg
>in
>order to debug a rather complex system.
>
>
>I’ve toyed with sending an IOCTL to my own driver in order to simulate
>this but is there a better way?
>
>Ralph
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@guillemot.com To
>unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@dos32.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@dos32.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

I’m talking out of ignorance, but does Windbg have conditional breakpoints ?
If I wanted to do that kind of thing with SoftICE, one way would be to have
the debugger and the app to break on the same condition.

Alberto.

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Wednesday, July 02, 2003 3:31 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Something like OutputDebugString

Timestamps don’t provide exact correlation but they do provide loose
correlation, which in my experience is generally good enough, if somewhat
painful to collate.

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
Sent: Wednesday, July 02, 2003 3:21 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Something like OutputDebugString

Dear Mark:

On Wed, 2 Jul 2003 13:42:09 -0400 , you wrote:

OutputDebugString works if you don’t have an active application
debugger. In that case if there is an active kernel debugger the output
will appear on the debugger console. If you have an active application
debugger you are out of luck. Try using timestamps to correlate
activity.

I thought about that but it really doesn’t solve the problem, does it?

Anyway, it sure looks like I’m going to have to home brew some stuff.

Amazing how hard simple things are to do in this environment.

Mark, thanks for your help and definitive answer.

Ralph

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
Sent: Wednesday, July 02, 2003 1:31 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Something like OutputDebugString

Dear Mat:

>From http://www.osr.com/ddk/ddtools/debugfns_9ecz.htm:


Only kernel-mode drivers can call the DbgPrint routine.


I find no other documentation for DbgPrint. I can’t find any SDK-level
headers that seem to declare DbgPrint in any way that I can link with.

What am I missing?

Ralph

On Wed, 2 Jul 2003 12:25:51 -0400 , you wrote:

>DbgPrint()
>
>Enjoy! :slight_smile:
>Mat
>
>-----Original Message-----
>From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
>Sent: Wednesday, July 02, 2003 12:17 PM
>To: NT Developers Interest List
>Subject: [ntdev] Something like OutputDebugString
>
>I feel so embarrassed but I’ve been looking and looking and can’t find
>the answer to what should be an easy question.
>
>I’m looking for something like OutputDebugString and/or KdPrint for
>user mode.
>
>That is, I want my user mode application to be able to do the
>equivalent of a KdPrint so that I can see some output on the WinDbg
>command window. As you probably know, OutputDebugString will send
>debugging output to the application debugger rather than the kernel
>mode debugger.
>
>As you’ve probably guessed, I’m running both the VC++ IDE and WinDbg
>in
>order to debug a rather complex system.
>
>
>I’ve toyed with sending an IOCTL to my own driver in order to simulate
>this but is there a better way?
>
>Ralph
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@guillemot.com To
>unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@dos32.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@dos32.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

Dear Srin:

On Wed, 2 Jul 2003 12:36:17 -0500, you wrote:

Ralph,
If you do not run VC++ IDE, OutputDebugString displays the
output in WinDBG. I have never used windbg and VC++ IDE at the same
time, so I cannot say what happens in this scenario.

It goes to the VC++ IDE.

-Srin.

Ralph

> -----Original Message-----
> From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
> Sent: Wednesday, July 02, 2003 10:31 AM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Something like OutputDebugString
>
> Dear Mat:
>
> From http://www.osr.com/ddk/ddtools/debugfns_9ecz.htm:
> - - - -
> Only kernel-mode drivers can call the DbgPrint routine.
> - - - -
>
> I find no other documentation for DbgPrint. I can’t find any
SDK-level
> headers that seem to declare DbgPrint in any way that I can link with.
>
> What am I missing?
>
> Ralph
>
>
>
> On Wed, 2 Jul 2003 12:25:51 -0400 , you wrote:
>
> >DbgPrint()
> >
> >Enjoy! :slight_smile:
> >Mat
> >
> >-----Original Message-----
> >From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
> >Sent: Wednesday, July 02, 2003 12:17 PM
> >To: NT Developers Interest List
> >Subject: [ntdev] Something like OutputDebugString
> >
> >I feel so embarrassed but I’ve been looking and looking and can’t
find
> the
> >answer to what should be an easy question.
> >
> >I’m looking for something like OutputDebugString and/or KdPrint for
user
> >mode.
> >
> >That is, I want my user mode application to be able to do the
equivalent
> of
> >a KdPrint so that I can see some output on the WinDbg command window.
As
> >you probably know, OutputDebugString will send debugging output to
the
> >application debugger rather than the kernel mode debugger.
> >
> >As you’ve probably guessed, I’m running both the VC++ IDE and WinDbg
in
> >order to debug a rather complex system.
> >
> >
> >I’ve toyed with sending an IOCTL to my own driver in order to
simulate
> this
> >but is there a better way?
> >
> >Ralph
> >
> >
> >—
> >You are currently subscribed to ntdev as: xxxxx@guillemot.com
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >—
> >You are currently subscribed to ntdev as: xxxxx@dos32.com
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@nai.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@dos32.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Dear Mat:

On Wed, 2 Jul 2003 13:32:06 -0400 , you wrote:

Sorry, I guess I read too fast! embarrassing.

Well, OutputDebugString() should work, doesn’t it?

Well, you’re still reading too fast. :slight_smile:

When running the VC++ IDE, OutputDebugString() is captured by the IDE’s
debugger console. So in that sense, yes it does work but it does not do
what I want it to: go to WinDbg’s command window (which is where KdPrint()
will send it.)

Mat

Ralph

-----Original Message-----
From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
Sent: Wednesday, July 02, 2003 1:31 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Something like OutputDebugString

Dear Mat:

>From http://www.osr.com/ddk/ddtools/debugfns_9ecz.htm:


Only kernel-mode drivers can call the DbgPrint routine.


I find no other documentation for DbgPrint. I can’t find any SDK-level
headers that seem to declare DbgPrint in any way that I can link with.

What am I missing?

Ralph

On Wed, 2 Jul 2003 12:25:51 -0400 , you wrote:

>DbgPrint()
>
>Enjoy! :slight_smile:
>Mat
>
>-----Original Message-----
>From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
>Sent: Wednesday, July 02, 2003 12:17 PM
>To: NT Developers Interest List
>Subject: [ntdev] Something like OutputDebugString
>
>I feel so embarrassed but I’ve been looking and looking and can’t find the
>answer to what should be an easy question.
>
>I’m looking for something like OutputDebugString and/or KdPrint for user
>mode.
>
>That is, I want my user mode application to be able to do the equivalent of
>a KdPrint so that I can see some output on the WinDbg command window. As
>you probably know, OutputDebugString will send debugging output to the
>application debugger rather than the kernel mode debugger.
>
>As you’ve probably guessed, I’m running both the VC++ IDE and WinDbg in
>order to debug a rather complex system.
>
>
>I’ve toyed with sending an IOCTL to my own driver in order to simulate this
>but is there a better way?
>
>Ralph
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@guillemot.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@dos32.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@guillemot.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@dos32.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Write a trivial driver and ioctl your log messages to it. Have it
KdPrint from there.

-sd

On Wed, 2003-07-02 at 15:45, Ralph Shnelvar wrote:

Dear Srin:

On Wed, 2 Jul 2003 12:36:17 -0500, you wrote:

>Ralph,
> If you do not run VC++ IDE, OutputDebugString displays the
>output in WinDBG. I have never used windbg and VC++ IDE at the same
>time, so I cannot say what happens in this scenario.

It goes to the VC++ IDE.

>
>-Srin.

Ralph

>
>> -----Original Message-----
>> From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
>> Sent: Wednesday, July 02, 2003 10:31 AM
>> To: NT Developers Interest List
>> Subject: [ntdev] RE: Something like OutputDebugString
>>
>> Dear Mat:
>>
>> From http://www.osr.com/ddk/ddtools/debugfns_9ecz.htm:
>> - - - -
>> Only kernel-mode drivers can call the DbgPrint routine.
>> - - - -
>>
>> I find no other documentation for DbgPrint. I can’t find any
>SDK-level
>> headers that seem to declare DbgPrint in any way that I can link with.
>>
>> What am I missing?
>>
>> Ralph
>>
>>
>>
>> On Wed, 2 Jul 2003 12:25:51 -0400 , you wrote:
>>
>> >DbgPrint()
>> >
>> >Enjoy! :slight_smile:
>> >Mat
>> >
>> >-----Original Message-----
>> >From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
>> >Sent: Wednesday, July 02, 2003 12:17 PM
>> >To: NT Developers Interest List
>> >Subject: [ntdev] Something like OutputDebugString
>> >
>> >I feel so embarrassed but I’ve been looking and looking and can’t
>find
>> the
>> >answer to what should be an easy question.
>> >
>> >I’m looking for something like OutputDebugString and/or KdPrint for
>user
>> >mode.
>> >
>> >That is, I want my user mode application to be able to do the
>equivalent
>> of
>> >a KdPrint so that I can see some output on the WinDbg command window.
>As
>> >you probably know, OutputDebugString will send debugging output to
>the
>> >application debugger rather than the kernel mode debugger.
>> >
>> >As you’ve probably guessed, I’m running both the VC++ IDE and WinDbg
>in
>> >order to debug a rather complex system.
>> >
>> >
>> >I’ve toyed with sending an IOCTL to my own driver in order to
>simulate
>> this
>> >but is there a better way?
>> >
>> >Ralph
>> >
>> >
>> >—
>> >You are currently subscribed to ntdev as: xxxxx@guillemot.com
>> >To unsubscribe send a blank email to xxxxx@lists.osr.com
>> >
>> >
>> >—
>> >You are currently subscribed to ntdev as: xxxxx@dos32.com
>> >To unsubscribe send a blank email to xxxxx@lists.osr.com
>>
>>
>>
>> —
>> You are currently subscribed to ntdev as: xxxxx@nai.com
>> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@dos32.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@positivenetworks.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

Yes, you can build conditional breakpoints using the “j” (Execute if-else)
command. See the Windbg help on Breakpoints for some examples.

Marybeth Croci

-----Original Message-----
From: Moreira, Alberto [mailto:xxxxx@compuware.com]
Sent: Wednesday, July 02, 2003 3:53 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Something like OutputDebugString

I’m talking out of ignorance, but does Windbg have conditional breakpoints ?
If I wanted to do that kind of thing with SoftICE, one way would be to have
the debugger and the app to break on the same condition.

Alberto.

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Wednesday, July 02, 2003 3:31 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Something like OutputDebugString

Timestamps don’t provide exact correlation but they do provide loose
correlation, which in my experience is generally good enough, if somewhat
painful to collate.

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
Sent: Wednesday, July 02, 2003 3:21 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Something like OutputDebugString

Dear Mark:

On Wed, 2 Jul 2003 13:42:09 -0400 , you wrote:

OutputDebugString works if you don’t have an active application
debugger. In that case if there is an active kernel debugger the output
will appear on the debugger console. If you have an active application
debugger you are out of luck. Try using timestamps to correlate
activity.

I thought about that but it really doesn’t solve the problem, does it?

Anyway, it sure looks like I’m going to have to home brew some stuff.

Amazing how hard simple things are to do in this environment.

Mark, thanks for your help and definitive answer.

Ralph

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
Sent: Wednesday, July 02, 2003 1:31 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Something like OutputDebugString

Dear Mat:

>From http://www.osr.com/ddk/ddtools/debugfns_9ecz.htm:


Only kernel-mode drivers can call the DbgPrint routine.


I find no other documentation for DbgPrint. I can’t find any SDK-level
headers that seem to declare DbgPrint in any way that I can link with.

What am I missing?

Ralph

On Wed, 2 Jul 2003 12:25:51 -0400 , you wrote:

>DbgPrint()
>
>Enjoy! :slight_smile:
>Mat
>
>-----Original Message-----
>From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
>Sent: Wednesday, July 02, 2003 12:17 PM
>To: NT Developers Interest List
>Subject: [ntdev] Something like OutputDebugString
>
>I feel so embarrassed but I’ve been looking and looking and can’t find
>the answer to what should be an easy question.
>
>I’m looking for something like OutputDebugString and/or KdPrint for
>user mode.
>
>That is, I want my user mode application to be able to do the
>equivalent of a KdPrint so that I can see some output on the WinDbg
>command window. As you probably know, OutputDebugString will send
>debugging output to the application debugger rather than the kernel
>mode debugger.
>
>As you’ve probably guessed, I’m running both the VC++ IDE and WinDbg
>in
>order to debug a rather complex system.
>
>
>I’ve toyed with sending an IOCTL to my own driver in order to simulate
>this but is there a better way?
>
>Ralph
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@guillemot.com To
>unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@dos32.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@dos32.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

DebugView from www.sysinternals.com allows to trace both types ( kernel & user ) at the same time - with time stamps - allowing you
to view the correlation. I am not sure , but IIRC , it can run in parallel with VC ( and maybe with WinDbg ) thus viewing the trace
output twice. Jose Flores ( www.joseflores.com ) has ever published an article on debugging, the result was a similar tool as
DebugView + source code.

Christiaan

----- Original Message -----
From: “Ralph Shnelvar”
To: “NT Developers Interest List”
Sent: Wednesday, July 02, 2003 6:17 PM
Subject: [ntdev] Something like OutputDebugString

> I feel so embarrassed but I’ve been looking and looking and can’t find the
> answer to what should be an easy question.
>
> I’m looking for something like OutputDebugString and/or KdPrint for user
> mode.
>
> That is, I want my user mode application to be able to do the equivalent of
> a KdPrint so that I can see some output on the WinDbg command window. As
> you probably know, OutputDebugString will send debugging output to the
> application debugger rather than the kernel mode debugger.
>
> As you’ve probably guessed, I’m running both the VC++ IDE and WinDbg in
> order to debug a rather complex system.
>
>
> I’ve toyed with sending an IOCTL to my own driver in order to simulate this
> but is there a better way?
>
> Ralph
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@compaqnet.be
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

> I’m talking out of ignorance, but does Windbg have conditional
breakpoints ?

You can specify the commands to be executed on breakpoint, and these
commands can include the condition and do “g” if it is false.

Max

> DebugView from www.sysinternals.com allows to trace both types ( kernel &
user ) at the same time - with time stamps - allowing you

to view the correlation. I am not sure , but IIRC , it can run in
parallel with VC ( and maybe with WinDbg ) thus viewing the trace
output twice.

Unfortunately not. I do this all the time, and the result is that when VC++
is attached to the app, Dbgview doesn’t get any of the debug output from the
app. Which can make debugging interaction problems between 3-4 copies of a
program mildly annoying. You can get sequenced interspersed debug in
Dbgview, but as soon as you attach the debugger to one of the copies of the
app (so you can debug, duh), that app output drops out of the interspersed
output in Dbgview. In my case this is only an annoyance, but I can see how
it could be considerably more than that under other circumstances.

Loren

“Loren Wilton” wrote in message news:xxxxx@ntdev…
>
> > DebugView from www.sysinternals.com allows to trace both types ( kernel
&
> user ) at the same time - with time stamps - allowing you
> > to view the correlation. I am not sure , but IIRC , it can run in
> parallel with VC ( and maybe with WinDbg ) thus viewing the trace
> > output twice.
>
> Unfortunately not. I do this all the time, and the result is that when
VC++
> is attached to the app, Dbgview doesn’t get any of the debug output from
the
> app.
>

Do you happen to know if our (i.e. OSR’s) DbgMon
(http://www.osronline.com/article.cfm?id=99) exhibits this same behavior?

Not being an app developer, I have no way of even trying this. But I do
seem to remember that it used to display app OutputDebugString data.

Note that the mechanisms for displaying debug output change over time – If
neither of these apps shows user-mode debug output, that’s probably the
reason.

Peter
OSR

> > Unfortunately not. I do this all the time, and the result is that when
VC++

> is attached to the app, Dbgview doesn’t get any of the debug output from
the app.

Do you happen to know if our (i.e. OSR’s) DbgMon
(http://www.osronline.com/article.cfm?id=99) exhibits this same behavior?

Ok, I tried it, and it does indeed work the same way. If I don’t start the
app from VC++ then the debug goes to Dbgmon as you would expect. If I do
start the app from VC++, then it captures the debug from the app, and Dbgmon
continues to capture debug from other apps and parts of the system.

Makes me curious enough that I’ll try to remember it when I get back to work
Monday and look at the source and see what is happening.

Loren

Actually, your answer was right. It is possible to use DbgPrint from user
mode to avoid mentioned problems. However, other problems can arise.

How to do it:

  • copy a prototype of DbgPrint from DDK headers
  • optionally write a macro similar to KdPrint for debug and release versions
  • link your user mode app with ntdll.lib from DDK

Problems:

  • it is undocumented
  • some debug monitors won’t capture it. DebugView doesn’t, SoftICE does and
    WinDbg as kernel debugger should (haven’t tried).

I tried it successfully at NT4 but stopped using it because like DebugView.

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]


From: xxxxx@guillemot.com[SMTP:xxxxx@guillemot.com]
Reply To: xxxxx@lists.osr.com
Sent: Wednesday, July 02, 2003 7:32 PM
To: xxxxx@lists.osr.com
Subject: [ntdev] RE: Something like OutputDebugString

Sorry, I guess I read too fast! embarrassing.

Well, OutputDebugString() should work, doesn’t it?

Mat

-----Original Message-----
From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
Sent: Wednesday, July 02, 2003 1:31 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Something like OutputDebugString

Dear Mat:

From http://www.osr.com/ddk/ddtools/debugfns_9ecz.htm:


Only kernel-mode drivers can call the DbgPrint routine.


I find no other documentation for DbgPrint. I can’t find any SDK-level
headers that seem to declare DbgPrint in any way that I can link with.

What am I missing?

Ralph

On Wed, 2 Jul 2003 12:25:51 -0400 , you wrote:

>DbgPrint()
>
>Enjoy! :slight_smile:
>Mat
>
>-----Original Message-----
>From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
>Sent: Wednesday, July 02, 2003 12:17 PM
>To: NT Developers Interest List
>Subject: [ntdev] Something like OutputDebugString
>
>I feel so embarrassed but I’ve been looking and looking and can’t find
the
>answer to what should be an easy question.
>
>I’m looking for something like OutputDebugString and/or KdPrint for user
>mode.
>
>That is, I want my user mode application to be able to do the equivalent
of
>a KdPrint so that I can see some output on the WinDbg command window. As
>you probably know, OutputDebugString will send debugging output to the
>application debugger rather than the kernel mode debugger.
>
>As you’ve probably guessed, I’m running both the VC++ IDE and WinDbg in
>order to debug a rather complex system.
>
>
>I’ve toyed with sending an IOCTL to my own driver in order to simulate
this
>but is there a better way?
>
>Ralph
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@guillemot.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@dos32.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@guillemot.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: michal.vodicka@st.com
To unsubscribe send a blank email to xxxxx@lists.osr.com