WinDbg Waiting to reconnect ...

Hi,

I want to debug our own WDM driver. I want that WinDbg will stop when DriverEntry is called during booting.

I tried and read a lot but it didn?t work.

On the Computer where the driver is running, Windows 7 is installed. In the command line (which I started with administrator rights ( run as admin ) ) I typed

bcdedit /dbgsettings serial debugport:1 baudrate:115200
bcdedit /debug on

On the other Computer With the latest WinDbg version I set correct values for the following environment variables:

_NT_DEBUG_PORT = com1
_NT_DEBUG_BAUD_RATE = 115200
_NT_SYMBOL_PATH = SRV*D:\Symbols*http://msdl.microsoft.com/download/symbols;D:\OurDriver\objchk_win7_x86\i386
_NT_SOURCE_PATH = D:\OurDriver
_NT_DEBUG_LOG_FILE_OPEN = D:\OurDriver\WinDbg.log

Then I started WinDbg ?k. It opend with the message
Opened \. \com1
Waiting to reconnect ?

Now I reseted the other prepared computer ( the computer with the driver ).

But the computer with the driver booted as it always did. It went up right into Windows without any breaks.

And the WinDbg on the other computer still showed:
Opened \. \com1
Waiting to reconnect ?


I googled a lot and tried several things. But nothing worked.


I used PuTTY to check whether the serial connection is ok. This is ok :=) One simple success :=)


Instead of bcdedit I also tried it with msconfig.


I inserted:
KdBreakPoint();
in the DriverEntry function. ? With the fresh compiled OurDriver.sys the Windows really stopped. But the WinDbg on the other machine still said:
Opened \. \com1
Waiting to reconnect ?


I deinstalled the driver of the com1 port on the computer which contains the driver. Since I read somewhere, that the com port must be legacy without any driver.


I googled a lot and tried this test several times. I have no more idea what else I can do.

+++++++++++++++++++
A. Please help me:
+++++++++++++++++++
Can you tell me please what might be wrong in my environment. What I missed to do. What else I can test.

  • Thanks in advance for all your hints.

+++++++++++++++++++
B. Furhter questions:
+++++++++++++++++++
Can you also answer me please my questions:

  1. When I tried to set a break point in WinDbg, I got a dialog telling me ?Debugger must be stopped before breakpoint can be modified?. Even when I started the WinDbg without the option ?k I received this Dialog box when I tried to set a breakpoint.
  • How can I stop the debugger ? (I wasn?t able to do this)
  1. If everything would work fine. And there wouldn?t be any KdBreakPoint(); in my code. Where would the debugger break / stop, when Windows is booting?

  2. Can somebody please tell me a link to a good ?Getting Started ? for debugging a WDM driver with WinDbg over a regular COM (com1) interface with a null modem cable?

  3. May be there is another forum here in the MSDN which better fits may problem / questions. If so, can you please tell me it?s name.

Thanks in advance for all your help!

Andreas,

Try to set up the connection thru the settings dialog instead of using
environment variables on the host.

–pa

wrote in message news:xxxxx@windbg…
> Hi,
>
> I want to debug our own WDM driver. I want that WinDbg will stop when
> DriverEntry is called during booting.
>
> I tried and read a lot but it didn?t work.
>
>
>
> On the Computer where the driver is running, Windows 7 is installed. In
> the command line (which I started with administrator rights ( run as
> admin ) ) I typed
>
> bcdedit /dbgsettings serial debugport:1 baudrate:115200
> bcdedit /debug on
>
> On the other Computer With the latest WinDbg version I set correct values
> for the following environment variables:
>
> _NT_DEBUG_PORT = com1
> _NT_DEBUG_BAUD_RATE = 115200
> _NT_SYMBOL_PATH =
> SRVD:\Symbolshttp://msdl.microsoft.com/download/symbols;D:\OurDriver\objchk_win7_x86\i386
> _NT_SOURCE_PATH = D:\OurDriver
> _NT_DEBUG_LOG_FILE_OPEN = D:\OurDriver\WinDbg.log
>
> Then I started WinDbg ?k. It opend with the message
> Opened \. \com1
> Waiting to reconnect ?
>
> Now I reseted the other prepared computer ( the computer with the
> driver ).
>
> But the computer with the driver booted as it always did. It went up right
> into Windows without any breaks.
>
> And the WinDbg on the other computer still showed:
> Opened \. \com1
> Waiting to reconnect ?
>
>
>
> ---------------------------------------------------------------------------------------------------
> I googled a lot and tried several things. But nothing worked.
>
>
> 1.
> -------
> I used PuTTY to check whether the serial connection is ok. This is ok
> :=) One simple success :=)
>
>
> 2.
> -------
> Instead of bcdedit I also tried it with msconfig.
>
>
> 3.
> -------
> I inserted:
> KdBreakPoint();
> in the DriverEntry function. ? With the fresh compiled OurDriver.sys the
> Windows really stopped. But the WinDbg on the other machine still said:
> Opened \. \com1
> Waiting to reconnect ?
>
>
> 4.
> -------
> I deinstalled the driver of the com1 port on the computer which contains
> the driver. Since I read somewhere, that the com port must be legacy
> without any driver.
>
>
> ---------------------------------------------------------------------------------------------------
>
> I googled a lot and tried this test several times. I have no more idea
> what else I can do.
>
>
> +++++++++++++++++++
> A. Please help me:
> +++++++++++++++++++
> Can you tell me please what might be wrong in my environment. What I
> missed to do. What else I can test.
>
> - Thanks in advance for all your hints.
>
>
> +++++++++++++++++++
> B. Furhter questions:
> +++++++++++++++++++
> Can you also answer me please my questions:
>
> 1. When I tried to set a break point in WinDbg, I got a dialog telling
> me ?Debugger must be stopped before breakpoint can be modified?. Even
> when I started the WinDbg without the option ?k I received this Dialog box
> when I tried to set a breakpoint.
>
> - How can I stop the debugger ? (I wasn?t able to do this)
>
>
> 2. If everything would work fine. And there wouldn?t be any
> KdBreakPoint(); in my code. Where would the debugger break / stop, when
> Windows is booting?
>
> 3. Can somebody please tell me a link to a good ?Getting Started ? for
> debugging a WDM driver with WinDbg over a regular COM (com1) interface
> with a null modem cable?
>
> 4. May be there is another forum here in the MSDN which better fits may
> problem / questions. If so, can you please tell me it?s name.
>
>
>
>
> Thanks in advance for all your help!
>

wrote in message news:xxxxx@windbg…

> Can you also answer me please my questions:
>
> 1. When I tried to set a break point in WinDbg, I got a dialog telling
> me ?Debugger must be stopped before breakpoint can be modified?. Even
> when I started the WinDbg without the option ?k I received this Dialog box
> when I tried to set a breakpoint.
>
> - How can I stop the debugger ? (I wasn?t able to do this)

This actually means to stop the target, not the debugger.
The target must be stopped by breakpoint, or you break into it by clicking
the “hand” icon on toolbar.
For this you need connection with the target, which you have not achieved
yet.

> 2. If everything would work fine. And there wouldn?t be any
> KdBreakPoint(); in my code. Where would the debugger break / stop, when
> Windows is booting?

If initial breakpoint is specified, it will break very early. You can be
sure this breakpoint is well before your driver.

> 3. Can somebody please tell me a link to a good ?Getting Started ? for
> debugging a WDM driver with WinDbg over a regular COM (com1) interface
> with a null modem cable?

IMHO the “getting started” part of Windbg help file is very good and
accurate. Most of other sources are at least a bit outdated.

>
> 4. May be there is another forum here in the MSDN which better fits may
> problem / questions. If so, can you please tell me it?s name.

You are already in the very best windbg forum.

The Microsoft’s own forum, if you wish, is at
http://social.msdn.microsoft.com/Forums/en-US/windbg/threads

Regards,
– pa

>>>>On Fri, Jan 21, 2011 at 3:49 PM, wrote:

>>>>On the other Computer With the latest WinDbg version I set correct
values for the following environment variables:

i normally do not set any environment variable except _NT_SYMBOL_PATH

to start windbg i use a bat file

C:>set _nt
_NT_SYMBOL_PATH=SRVF:\symbolshttp://msdl.microsoft.com/download/symbols

C:>type f:\windbg\612windbg\kerndbg.bat
windbg -k com:pipe,port=\.\pipe\debugPipe,resets=0,reconnect (for VPC
2007)
C:>

- >>>How can I stop the debugger ? (I wasn?t able to do this)

to stop debugger use ctrl+ break

>>>>>>2. If everything would work fine. And there wouldn?t be any
KdBreakPoint(); in my code. Where would the debugger break / stop, when
Windows is booting?

debugger will not stop unless you request it to stop either using
commandline options -b -d etc

or use ctrl+alt+k and cycle

thanks and regards

raj_r

… and the serial cable was plugged into the proper port on both machines,
and you verified both comports work using HyperTerminal?

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@siemens.com
Sent: Friday, January 21, 2011 4:20 AM
To: Kernel Debugging Interest List
Subject: [windbg] WinDbg Waiting to reconnect …

Hi,

I want to debug our own WDM driver. I want that WinDbg will stop when
DriverEntry is called during booting.

I tried and read a lot but it didn?t work.

On the Computer where the driver is running, Windows 7 is installed. In the
command line (which I started with administrator rights ( run as admin ) )
I typed

bcdedit /dbgsettings serial debugport:1 baudrate:115200
bcdedit /debug on

On the other Computer With the latest WinDbg version I set correct values
for the following environment variables:

_NT_DEBUG_PORT = com1
_NT_DEBUG_BAUD_RATE = 115200
_NT_SYMBOL_PATH =
SRV*D:\Symbols*http://msdl.microsoft.com/download/symbols;D:\OurDriver\objch
k_win7_x86\i386
_NT_SOURCE_PATH = D:\OurDriver
_NT_DEBUG_LOG_FILE_OPEN = D:\OurDriver\WinDbg.log

Then I started WinDbg ?k. It opend with the message
Opened \. \com1
Waiting to reconnect ?

Now I reseted the other prepared computer ( the computer with the driver ).

But the computer with the driver booted as it always did. It went up right
into Windows without any breaks.

And the WinDbg on the other computer still showed:
Opened \. \com1
Waiting to reconnect ?



I googled a lot and tried several things. But nothing worked.


I used PuTTY to check whether the serial connection is ok. This is ok :=)
One simple success :=)


Instead of bcdedit I also tried it with msconfig.


I inserted:
KdBreakPoint();
in the DriverEntry function. ? With the fresh compiled OurDriver.sys the
Windows really stopped. But the WinDbg on the other machine still said:
Opened \. \com1
Waiting to reconnect ?


I deinstalled the driver of the com1 port on the computer which contains the
driver. Since I read somewhere, that the com port must be legacy without any
driver.



I googled a lot and tried this test several times. I have no more idea what
else I can do.

+++++++++++++++++++
A. Please help me:
+++++++++++++++++++
Can you tell me please what might be wrong in my environment. What I missed
to do. What else I can test.

  • Thanks in advance for all your hints.

+++++++++++++++++++
B. Furhter questions:
+++++++++++++++++++
Can you also answer me please my questions:

  1. When I tried to set a break point in WinDbg, I got a dialog telling me
    ?Debugger must be stopped before breakpoint can be modified?. Even when I
    started the WinDbg without the option ?k I received this Dialog box when I
    tried to set a breakpoint.
  • How can I stop the debugger ? (I wasn?t able to do this)
  1. If everything would work fine. And there wouldn?t be any
    KdBreakPoint(); in my code. Where would the debugger break / stop, when
    Windows is booting?

  2. Can somebody please tell me a link to a good ?Getting Started ? for
    debugging a WDM driver with WinDbg over a regular COM (com1) interface with
    a null modem cable?

  3. May be there is another forum here in the MSDN which better fits may
    problem / questions. If so, can you please tell me it?s name.

Thanks in advance for all your help!


WINDBG 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

__________ Information from ESET Smart Security, version of virus signature
database 5807 (20110121) __________

The message was checked by ESET Smart Security.

http://www.eset.com

Just two small “sanity checks”:

On 01/21/2011 11:19 AM, xxxxx@siemens.com wrote:

bcdedit /dbgsettings serial debugport:1 baudrate:115200

=> This (“Target”) COM port *must* be real serial hardware.
A converter, e.g. a USB-to-serial cable will not work.

On the other Computer With the latest WinDbg version I set correct values for the following environment variables:

_NT_DEBUG_PORT = com1
_NT_DEBUG_BAUD_RATE = 115200

This is the COM port of the (“Host”) machine where WinDbg runs
(not the one of the target machine).
=> Is it really COM1?
=> Is this also *real* serial hardware, or a USB-to-serial converter?

I used PuTTY to check whether the serial connection is ok. This is ok :=) One simple success :=)

PuTTY or any other terminal program will also work with USB/serial
converter cables. But kernel debugging will not.

Thanks for all those answers and hints.

But unfortunately I still have the same problem. WinDbg still shows:
? Opened \. \ com1
Waiting to reconnect ?. ?

++++++++++++++++++++++++++++++++++++++++++++++++++++++


Further I disabled the ?Legacy USB Support? in the BIOS. Since I read somewhere, that this also might be the reason for the described problem. ==> But it didn?t help.


No it isn?t a USB to serial/com cable/adapter. It?s a real com port.


Further I played with the com 1 settings in the BIOS. I changed for com 1 ?Auto? to ?Enabled?. But it also changed anything.

Further there are following possible values for the com 1 interface:

Interrupt: IRQ3 or IRQ4
CAN Base I(O Address: 2E8 or 2F8 or 3E8 or 3F8

But here I changed nothing. I think it wouldn?t help in this situation.

Is this right? - Or not? Is a special interrupt/ address for the com1 necessary?


@ Pavel A: I opened Windbg?s Help.chm. But I did not saw the IMHO section you talked about. Where exactly is it?

Thanks in advance for all your answers.

Hi Andreas,

this section is in Debugers > Installation and setup > Kernel-mode setup >
Setting Up a Null-Modem Cable Connection

My first thought was that your problem is caused by spaces in the environment variables
( “set A=B” is not same as “set A = B” )

If this is not the case, maybe indeed the BIOS port settings are wrong.

How many ports you have? The debugger uses the highest COM port.
COM1 must have address 3F8 and IRQ4. COM2 - 2F8 and IRQ3.
Check that the port is not in use by something else (CAN, IR, GPS, various “management engines” …).

–pa

I replaced the computers hard drive and installed Windows XP. With Windows XP WinDbg worked fine.

==> The problem has to do something with Windows 7 on the computer with the driver.

What can this be?

Are there guys with experince in debugging a driver with WinDbg on a Windows 7 32 computer.

What might be the reason for the problem in my situation?

Thanks in advance for all your help.

I would agree with raj_r about not using environment variables for anything
other than symbol path - it can create very confusing results if you forget
that set them.

I’m a little confused as to what you’ve tried at this point; have you tried
using the ‘-b’ command line option?

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@siemens.com
Sent: Tuesday, January 25, 2011 10:39 AM
To: Kernel Debugging Interest List
Subject: RE:[windbg] WinDbg Waiting to reconnect …

I replaced the computers hard drive and installed Windows XP. With Windows
XP WinDbg worked fine.

==> The problem has to do something with Windows 7 on the computer with the
driver.

What can this be?

Are there guys with experince in debugging a driver with WinDbg on a
Windows 7 32 computer.

What might be the reason for the problem in my situation?

Thanks in advance for all your help.


WINDBG 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

Thanks I got a lot of answer e-mails. Since I thought that those answers also
will be posted here in the forum I deleted all thouse mails, before I went to
the forum here.

Unfortunately those answers only has been e-mails, which were not posted here.
So now those answers are lost for me.

Sorry I am new here in this forum.

I did not knew that.

Can you please send me your answers another time for the following topic:


Are there guys with experince in debugging a driver with WinDbg on a Windows 7
32 Bit computer.

What might be the reason for the problem in my situation?

Thanks in advance for all your help.

Now I used a complete fresh installed Windows 7.

Afterwards I enabled debugging with msconfig.

And now it works.

I guess the problem was somewhere in the old total wasted Windows 7 installation.

Thanks for all your helpful hints.

Thanks for letting us know.
– pa

wrote in message news:xxxxx@windbg…
> Now I used a complete fresh installed Windows 7.
>
> Afterwards I enabled debugging with msconfig.
>
> And now it works.
>
>
> I guess the problem was somewhere in the old total wasted Windows 7
> installation.
>
> Thanks for all your helpful hints.
>