How to use windbg to debug an application on another target computer?

Really? I can’t believe it. This is the next level of recklessness and/or stupidity after leaving unconditional debug prints in released code.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]


From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Chesong Lee[SMTP:xxxxx@enterprisent.com]
Reply To: Windows System Software Devs Interest List
Sent: Wednesday, December 19, 2007 1:27 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] RE:How to use windbg to debug an application on another target computer?

At least, please do not leave such *unconditional* DebugBreak() in
released device drivers or any applications. Even though the original
developers may want to break in for every time their driver or service
starts, we do not want to be interrupted by other’s DebugBreak() when
we debug ours. I have seen such behaviors in some device drivers and
user-mode applications as well.

Chesong Lee

On Dec 18, 2007 3:46 PM, wrote:
> > I remember reading this, and I thought it was for the drivers or kernel
> > modes. Actually I’ve been doing this for services for quite some time, and
> > did not hit so much of a trouble.
> >
> > If you remember anthing special please mention here ( before we spiral
> > into another undocumented stuff :slight_smile:
> >
> > And the service have been using is pretty darn large ( 3 to 4 hundred
> > thousand lines of frame work it is large telecom framework for voip type
> > stuff :slight_smile:
> >
> > -pro
> >
> >
> > > DO NOT DO THIS. Read NT Insider article about using this technique and
> > > the
> > > interrupt bit in the flags register. Been bit by it.
> > >
> > > “Prokash Sinha” wrote in message news:xxxxx@ntdev…
> > >> You can try the following two options ( whatever works for you ) -
> > >>
> > >> Since you said you are driver developer, and comfortable using kernel
> > >> debugger.
> > >>
> > >> 1) If you have the source of your application, at the start of your app
> > >> ( some main, Winmain, _tmain etc ) use a code something like this -
> > >>
> > >> __try {
> > >> DebugBreak(); // look at win32 api for Breakpointing
> > >> }
> > >>__except ( 1 )
> > >> {
> > >> //put some print stmt or even null stmt ( ; )
> > >> }
> > >>
> > >> Now build and run aftere you booted the target with kernel debugging
> > >> enabled. It would break in and you will have control in the windbg of
> > >> host machine. Now you can debug the app this way, but remember that you
> > >> are now using the windbg kernelmode debugging.
> > >>
> > >> 2) Or you can just bring up the windbg on the target machine, and
> > >> execute
> > >> or attach to the app from your debugger, it will break in to runtime
> > >> routines before your main gets called. At that point
> > >> issue the following command from your target machine’s debugger command
> > >> line -
> > >>
> > >> .server tcp:port=2000, icfenable
> > >>
> > >> Watch the string spews out as a response to your command
> > >>
> > >> Now on the host machine, bring up your windbg client, there is an option
> > >> for remote debugging, click that to get a dlg box prompt. Use the
> > >> machine
> > >> name or ip that prompted in your previous command as below
> > >>
> > >> tcp:port=2000,
> > >>
> > >> If you have XP firewall then you may have to go to control panel …
> > >> security configuration … firewall setting to allow windbg as an
> > >> exception. Most of the time disabling the firewall temporarily works
> > >> fine.
> > >>
> > >> I use option (1) whenever I do debug app or services …
> > >>
> > >> -pro
> > >> ----- Original Message -----
> > >> From:
> > >> To: “Windows System Software Devs Interest List”
> > >> Sent: Tuesday, December 18, 2007 2:25 AM>
> > >> Subject: RE:[ntdev] How to use windbg to debug an application on another
> > >> target computer?
> > >>
> > >>
> >
> > >>>I installed windbg on my target machine. And then I run the below
> > >>> command:
> > >>>
> > >>> dbgsrv.exe -t com:port=1,baud=115200
> > >>>
> > >>> but unluckily, it reports “StartProcessServer Error 0x80070057” .
> > >>> Oh!!!
> > >>>
> > >>> —
> > >>> NTDEV is sponsored by OSR
> > >>>
> > >>> For our schedule of WDF, WDM, debugging and other seminars visit:
> > >>> http://www.osr.com/seminars
> > >>>
> > >>> To unsubscribe, visit the List Server section of OSR Online at
> > >>> http://www.osronline.com/page.cfm?name=ListServer
> > >>
> > >>
> > >
> > >
> > >
> > > —
> > > NTDEV is sponsored by OSR
> > >
> > > For our schedule of WDF, WDM, debugging and other seminars visit:
> > > http://www.osr.com/seminars
> > >
> > > To unsubscribe, visit the List Server section of OSR Online at
> > > http://www.osronline.com/page.cfm?name=ListServer
> > >
> >
> >
> >
> > —
> > NTDEV is sponsored by OSR
> >
> > For our schedule of WDF, WDM, debugging and other seminars visit:
> > http://www.osr.com/seminars
> >
> > To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
> >
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>

Oh, Michal, and Lee you know that is a problem if someone leaves that way on
the release code. But then again, lot of macros of them should be defined as
NOP under release build, when DBG or _DEBUG or __DEBUG or DEBUG or some
such is not defined.

But everyone should / could wrap them to be not invoked under release
version.

I do use that as a seprate function, and invoking that or not is depeding on
if I’m debuggin or not.

Come on folks, we don’t have to baby feed everything. Do we???

-pro

On Dec 18, 2007 4:38 PM, Michal Vodicka wrote:

> Really? I can’t believe it. This is the next level of recklessness and/or
> stupidity after leaving unconditional debug prints in released code.
>
> Best regards,
>
> Michal Vodicka
> UPEK, Inc.
> [xxxxx@upek.com, http://www.upek.com]
>
> > ----------
> > From: xxxxx@lists.osr.com[
> SMTP:xxxxx@lists.osr.com] on behalf of Chesong Lee[
> SMTP:xxxxx@enterprisent.com]
> > Reply To: Windows System Software Devs Interest List
> > Sent: Wednesday, December 19, 2007 1:27 AM
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] RE:How to use windbg to debug an application
> on another target computer?
> >
> > At least, please do not leave such unconditional DebugBreak() in
> > released device drivers or any applications. Even though the original
> > developers may want to break in for every time their driver or service
> > starts, we do not want to be interrupted by other’s DebugBreak() when
> > we debug ours. I have seen such behaviors in some device drivers and
> > user-mode applications as well.
> >
> > Chesong Lee
> >
> >
> > On Dec 18, 2007 3:46 PM, wrote:
> > > I remember reading this, and I thought it was for the drivers or
> kernel
> > > modes. Actually I’ve been doing this for services for quite some time,
> and
> > > did not hit so much of a trouble.
> > >
> > > If you remember anthing special please mention here ( before we spiral
> > > into another undocumented stuff :slight_smile:
> > >
> > > And the service have been using is pretty darn large ( 3 to 4 hundred
> > > thousand lines of frame work it is large telecom framework for voip
> type
> > > stuff :slight_smile:
> > >
> > > -pro
> > >
> > >
> > > > DO NOT DO THIS. Read NT Insider article about using this technique
> and
> > > > the
> > > > interrupt bit in the flags register. Been bit by it.
> > > >
> > > > “Prokash Sinha” wrote in message
> news:xxxxx@ntdev…
> > > >> You can try the following two options ( whatever works for you ) -
> > > >>
> > > >> Since you said you are driver developer, and comfortable using
> kernel
> > > >> debugger.
> > > >>
> > > >> 1) If you have the source of your application, at the start of your
> app
> > > >> ( some main, Winmain, _tmain etc ) use a code something like this -
> > > >>
> > > >> __try {
> > > >> DebugBreak(); // look at win32 api for
> Breakpointing
> > > >> }
> > > >>__except ( 1 )
> > > >> {
> > > >> //put some print stmt or even null stmt ( ; )
> > > >> }
> > > >>
> > > >> Now build and run aftere you booted the target with kernel
> debugging
> > > >> enabled. It would break in and you will have control in the windbg
> of
> > > >> host machine. Now you can debug the app this way, but remember that
> you
> > > >> are now using the windbg kernelmode debugging.
> > > >>
> > > >> 2) Or you can just bring up the windbg on the target machine, and
> > > >> execute
> > > >> or attach to the app from your debugger, it will break in to
> runtime
> > > >> routines before your main gets called. At that point
> > > >> issue the following command from your target machine’s debugger
> command
> > > >> line -
> > > >>
> > > >> .server tcp:port=2000, icfenable
> > > >>
> > > >> Watch the string spews out as a response to your command
> > > >>
> > > >> Now on the host machine, bring up your windbg client, there is an
> option
> > > >> for remote debugging, click that to get a dlg box prompt. Use the
> > > >> machine
> > > >> name or ip that prompted in your previous command as below
> > > >>
> > > >> tcp:port=2000,
> > > >>
> > > >> If you have XP firewall then you may have to go to control panel
> …
> > > >> security configuration … firewall setting to allow windbg as an
> > > >> exception. Most of the time disabling the firewall temporarily
> works
> > > >> fine.
> > > >>
> > > >> I use option (1) whenever I do debug app or services …
> > > >>
> > > >> -pro
> > > >> ----- Original Message -----
> > > >> From:
> > > >> To: “Windows System Software Devs Interest List” <
> xxxxx@lists.osr.com>
> > > >> Sent: Tuesday, December 18, 2007 2:25 AM>
> > > >> Subject: RE:[ntdev] How to use windbg to debug an application on
> another
> > > >> target computer?
> > > >>
> > > >>
> > >
> > > >>>I installed windbg on my target machine. And then I run the below
> > > >>> command:
> > > >>>
> > > >>> dbgsrv.exe -t com:port=1,baud=115200
> > > >>>
> > > >>> but unluckily, it reports “StartProcessServer Error 0x80070057” .
> > > >>> Oh!!!
> > > >>>
> > > >>> —
> > > >>> NTDEV is sponsored by OSR
> > > >>>
> > > >>> For our schedule of WDF, WDM, debugging and other seminars visit:
> > > >>> http://www.osr.com/seminars
> > > >>>
> > > >>> To unsubscribe, visit the List Server section of OSR Online at
> > > >>> http://www.osronline.com/page.cfm?name=ListServer
> > > >>
> > > >>
> > > >
> > > >
> > > >
> > > > —
> > > > NTDEV is sponsored by OSR
> > > >
> > > > For our schedule of WDF, WDM, debugging and other seminars visit:
> > > > http://www.osr.com/seminars
> > > >
> > > > To unsubscribe, visit the List Server section of OSR Online at
> > > > http://www.osronline.com/page.cfm?name=ListServer
> > > >
> > >
> > >
> > >
> > > —
> > > NTDEV is sponsored by OSR
> > >
> > > For our schedule of WDF, WDM, debugging and other seminars visit:
> > > http://www.osr.com/seminars
> > >
> > > To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
> > >
> >
> > —
> > NTDEV is sponsored by OSR
> >
> > For our schedule of WDF, WDM, debugging and other seminars visit:
> > http://www.osr.com/seminars
> >
> > To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
> >
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

I think I can have a try. You mean I can use windbg's kernel mode to debug applications. Let me try. And I have forgot to tell you that I have only the released executable binary file, so I think I can use such as "int 3" to replace "DebugBreak(); " in the disassembling codes of the application. I will report my results after tests. Thank you.

  1. If you have the source of your application, at the start of your app (
    some main, Winmain, _tmain etc ) use a code something like this -

__try {
DebugBreak(); // look at win32 api for Breakpointing
}
__except ( 1 )
{
//put some print stmt or even null stmt ( ; )
}

Now build and run aftere you booted the target with kernel debugging
enabled. It would break in and you will have control in the windbg of host
machine. Now you can debug the app this way, but remember that you are now
using the windbg kernelmode debugging.

DebugBreak in kernel mode is a BSOD if the KD is not attached.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

“Chesong Lee” wrote in message news:xxxxx@ntdev…
> At least, please do not leave such unconditional DebugBreak() in
> released device drivers or any applications. Even though the original
> developers may want to break in for every time their driver or service
> starts, we do not want to be interrupted by other’s DebugBreak() when
> we debug ours. I have seen such behaviors in some device drivers and
> user-mode applications as well.
>
> Chesong Lee
>
>
> On Dec 18, 2007 3:46 PM, wrote:
> > I remember reading this, and I thought it was for the drivers or kernel
> > modes. Actually I’ve been doing this for services for quite some time, and
> > did not hit so much of a trouble.
> >
> > If you remember anthing special please mention here ( before we spiral
> > into another undocumented stuff :slight_smile:
> >
> > And the service have been using is pretty darn large ( 3 to 4 hundred
> > thousand lines of frame work it is large telecom framework for voip type
> > stuff :slight_smile:
> >
> > -pro
> >
> >
> > > DO NOT DO THIS. Read NT Insider article about using this technique and
> > > the
> > > interrupt bit in the flags register. Been bit by it.
> > >
> > > “Prokash Sinha” wrote in message news:xxxxx@ntdev…
> > >> You can try the following two options ( whatever works for you ) -
> > >>
> > >> Since you said you are driver developer, and comfortable using kernel
> > >> debugger.
> > >>
> > >> 1) If you have the source of your application, at the start of your app
> > >> ( some main, Winmain, _tmain etc ) use a code something like this -
> > >>
> > >> __try {
> > >> DebugBreak(); // look at win32 api for Breakpointing
> > >> }
> > >>__except ( 1 )
> > >> {
> > >> //put some print stmt or even null stmt ( ; )
> > >> }
> > >>
> > >> Now build and run aftere you booted the target with kernel debugging
> > >> enabled. It would break in and you will have control in the windbg of
> > >> host machine. Now you can debug the app this way, but remember that you
> > >> are now using the windbg kernelmode debugging.
> > >>
> > >> 2) Or you can just bring up the windbg on the target machine, and
> > >> execute
> > >> or attach to the app from your debugger, it will break in to runtime
> > >> routines before your main gets called. At that point
> > >> issue the following command from your target machine’s debugger command
> > >> line -
> > >>
> > >> .server tcp:port=2000, icfenable
> > >>
> > >> Watch the string spews out as a response to your command
> > >>
> > >> Now on the host machine, bring up your windbg client, there is an option
> > >> for remote debugging, click that to get a dlg box prompt. Use the
> > >> machine
> > >> name or ip that prompted in your previous command as below
> > >>
> > >> tcp:port=2000,
> > >>
> > >> If you have XP firewall then you may have to go to control panel …
> > >> security configuration … firewall setting to allow windbg as an
> > >> exception. Most of the time disabling the firewall temporarily works
> > >> fine.
> > >>
> > >> I use option (1) whenever I do debug app or services …
> > >>
> > >> -pro
> > >> ----- Original Message -----
> > >> From:
> > >> To: “Windows System Software Devs Interest List”
> > >> Sent: Tuesday, December 18, 2007 2:25 AM
> > >> Subject: RE:[ntdev] How to use windbg to debug an application on another
> > >> target computer?
> > >>
> > >>
> >
> > >>>I installed windbg on my target machine. And then I run the below
> > >>> command:
> > >>>
> > >>> dbgsrv.exe -t com:port=1,baud=115200
> > >>>
> > >>> but unluckily, it reports “StartProcessServer Error 0x80070057” .
> > >>> Oh!!!
> > >>>
> > >>> —
> > >>> NTDEV is sponsored by OSR
> > >>>
> > >>> For our schedule of WDF, WDM, debugging and other seminars visit:
> > >>> http://www.osr.com/seminars
> > >>>
> > >>> To unsubscribe, visit the List Server section of OSR Online at
> > >>> http://www.osronline.com/page.cfm?name=ListServer
> > >>
> > >>
> > >
> > >
> > >
> > > —
> > > NTDEV is sponsored by OSR
> > >
> > > For our schedule of WDF, WDM, debugging and other seminars visit:
> > > http://www.osr.com/seminars
> > >
> > > To unsubscribe, visit the List Server section of OSR Online at
> > > http://www.osronline.com/page.cfm?name=ListServer
> > >
> >
> >
> >
> > —
> > NTDEV is sponsored by OSR
> >
> > For our schedule of WDF, WDM, debugging and other seminars visit:
> > http://www.osr.com/seminars
> >
> > To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
> >
>

Sure, if it doesn’t stay in release code, there is no problem. Until you release debug version to customers :wink:

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]


From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Prokash Sinha[SMTP:xxxxx@gmail.com]
Reply To: Windows System Software Devs Interest List
Sent: Wednesday, December 19, 2007 2:55 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] RE:How to use windbg to debug an application on another target computer?

Oh, Michal, and Lee you know that is a problem if someone leaves that way on the release code. But then again, lot of macros of them should be defined as NOP under release build, when DBG or _DEBUG or __DEBUG or DEBUG or some such is not defined.

But everyone should / could wrap them to be not invoked under release version.

I do use that as a seprate function, and invoking that or not is depeding on if I’m debuggin or not.

Come on folks, we don’t have to baby feed everything. Do we???

-pro

On Dec 18, 2007 4:38 PM, Michal Vodicka > wrote:
>
>
> Really? I can’t believe it. This is the next level of recklessness and/or stupidity after leaving unconditional debug prints in released code.
>
> Best regards,
>
> Michal Vodicka
> UPEK, Inc.
> [xxxxx@upek.com mailto:xxxxx, http:</http:>]
>
> > ----------
> > From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com mailto:smtp:xxxxx] on behalf of Chesong Lee[SMTP:xxxxx@enterprisent.com mailto:smtp:xxxxx]
> > Reply To: Windows System Software Devs Interest List
> > Sent: Wednesday, December 19, 2007 1:27 AM
>
> > To: Windows System Software Devs Interest List
>
> > Subject: Re: [ntdev] RE:How to use windbg to debug an application on another target computer?
>
> >
> > At least, please do not leave such unconditional DebugBreak() in
> > released device drivers or any applications. Even though the original
> > developers may want to break in for every time their driver or service
> > starts, we do not want to be interrupted by other’s DebugBreak() when
> > we debug ours. I have seen such behaviors in some device drivers and
> > user-mode applications as well.
> >
> > Chesong Lee
> >
> >
> > On Dec 18, 2007 3:46 PM, > wrote:
> > > I remember reading this, and I thought it was for the drivers or kernel
> > > modes. Actually I’ve been doing this for services for quite some time, and
> > > did not hit so much of a trouble.
> > >
> > > If you remember anthing special please mention here ( before we spiral
> > > into another undocumented stuff :slight_smile:
> > >
> > > And the service have been using is pretty darn large ( 3 to 4 hundred
> > > thousand lines of frame work it is large telecom framework for voip type
> > > stuff :slight_smile:
> > >
> > > -pro
> > >
> > >
> > > > DO NOT DO THIS. Read NT Insider article about using this technique and
> > > > the
> > > > interrupt bit in the flags register. Been bit by it.
> > > >
> > > > “Prokash Sinha” > wrote in message news:xxxxx@ntdev…
> > > >> You can try the following two options ( whatever works for you ) -
> > > >>
> > > >> Since you said you are driver developer, and comfortable using kernel
> > > >> debugger.
> > > >>
> > > >> 1) If you have the source of your application, at the start of your app
> > > >> ( some main, Winmain, _tmain etc ) use a code something like this -
> > > >>
> > > >> __try {
> > > >> DebugBreak(); // look at win32 api for Breakpointing
> > > >> > }
> > > >>__except ( 1 )
> > > >> {
> > > >> //put some print stmt or even null stmt ( ; )
> > > >> }
> > > >>
> > > >> Now build and run aftere you booted the target with kernel debugging
> > > >> enabled. It would break in and you will have control in the windbg of
> > > >> host machine. Now you can debug the app this way, but remember that you
> > > >> are now using the windbg kernelmode debugging.
> > > >>
> > > >> 2) Or you can just bring up the windbg on the target machine, and
> > > >> execute
> > > >> or attach to the app from your debugger, it will break in to runtime
> > > >> routines before your main gets called. At that point
> > > >> issue the following command from your target machine’s debugger command
> > > >> line -
> > > >>
> > > >> .server tcp:port=2000, icfenable
> > > >>
> > > >> Watch the string spews out as a response to your command
> > > >>
> > > >> Now on the host machine, bring up your windbg client, there is an option
> > > >> for remote debugging, click that to get a dlg box prompt. Use the
> > > >> machine
> > > >> name or ip that prompted in your previous command as below
> > > >>
> > > >> tcp:port=2000,
> > > >>
> > > >> If you have XP firewall then you may have to go to control panel …
> > > >> security configuration … firewall setting to allow windbg as an
> > > >> exception. Most of the time disabling the firewall temporarily works
> > > >> fine.
> > > >>
> > > >> I use option (1) whenever I do debug app or services …
> > > >>
> > > >> -pro
> > > >> ----- Original Message -----
> > > >> From: >
> > > >> To: “Windows System Software Devs Interest List” < xxxxx@lists.osr.com mailto:xxxxx>
> > > >> Sent: Tuesday, December 18, 2007 2:25 AM>
> > > >> Subject: RE:[ntdev] How to use windbg to debug an application on another
> > > >> target computer?
> > > >>
> > > >>
> > >
> > > >>>I installed windbg on my target machine. And then I run the below
> > > >>> command:
> > > >>>
> > > >>> dbgsrv.exe -t com:port=1,baud=115200
> > > >>>
> > > >>> but unluckily, it reports “StartProcessServer Error 0x80070057” .
> > > >>> Oh!!!
> > > >>>
> > > >>> —
> > > >>> NTDEV is sponsored by OSR
> > > >>>
> > > >>> For our schedule of WDF, WDM, debugging and other seminars visit:
> > > >>> http:
> > > >>>
> > > >>> To unsubscribe, visit the List Server section of OSR Online at
> > > >>> http:
> > > >>
> > > >>
> > > >
> > > >
> > > >
> > > > —
> > > > NTDEV is sponsored by OSR
> > > >
> > > > For our schedule of WDF, WDM, debugging and other seminars visit:
> > > > http:
> > > >
> > > > To unsubscribe, visit the List Server section of OSR Online at
> > > > http:
> > > >
> > >
> > >
> > >
> > > —
> > > NTDEV is sponsored by OSR
> > >
> > > For our schedule of WDF, WDM, debugging and other seminars visit:
> > > http:
> > >
> > > To unsubscribe, visit the List Server section of OSR Online at http:
> > >
> >
> > —
> > NTDEV is sponsored by OSR
> >
> > For our schedule of WDF, WDM, debugging and other seminars visit:
> > http:
> >
> > To unsubscribe, visit the List Server section of OSR Online at http:
> >
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http:
>
> To unsubscribe, visit the List Server section of OSR Online at http:
>
>
>
> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars&gt; To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
></http:></http:></http:></http:></http:></http:></http:></http:></http:></http:></mailto:xxxxx></mailto:smtp:xxxxx></mailto:smtp:xxxxx></mailto:xxxxx>

Wonderful. I succeed. Just:
.server -t com:port=com1,baud=115200
windbg .remote com:port=com1,baud=115200
And then I use windbg from client to attach the application on the server.
So thank you everyone that helped me on OSR. Thank you very much for your heartness!