none
can't break into kernel debugger after deploying driver in vs2015 professional with update2 RRS feed

  • Question

  • I am trying to set up remote driver debugging in visual studio 2015 professional with update2. My host computer is running in Windows 8.1 home-edition 64 bit, and the target is a separate computer which runs in Windows 10 home-edition 64 bit. I can provision/configure the target computer successfully, and next I press F5 to debug/deploy the KMDF driver, it takes about 2 minutes to deploy driver and then deploy's process stops, and then I press "break all" button to break the debugger, nothing is happened, it can't break the debugger, so this means driver's deploy is not yet complete, but oddly no any error message about deploy is show.
    Here is the informaiton on the output of "Debugger Immediate Window" during deploy stage. This issue has taked me several weeks to solve it, but I still can't. I hope someone can help me to solve it or give me some advice, appreciated !
    Microsoft (R) Windows Debugger Version 10.0.10586.567 AMD64
    Copyright (c) Microsoft Corporation. All rights reserved.
    
    SIMON\simon96 (npipe WinIDE_01D1BFBFC94007E3) connected at Mon Jun 06 14:51:00 2016
    
    Microsoft (R) Windows Debugger Version 10.0.10586.567 AMD64
    Copyright (c) Microsoft Corporation. All rights reserved.
    
    Using NET for debugging
    Opened WinSock 2.0
    Waiting to reconnect...
    [14:51:01:965]: Remove Existing Remote Package
    [14:51:02:028]: Task "Remove Existing Remote Package" completed successfully
    [14:51:02:028]: Copy Driver Package
    [14:51:02:434]: Task "Copy Driver Package" completed successfully
    [14:51:02:449]: Driver Removal
    [14:51:02:449]: Removing any existing files from test execution folder.
    [14:51:02:543]: Copying required files for "Driver Removal".
    
    $KitRoot$\Testing\Runtimes\TAEF\te.exe "%SystemDrive%\DriverTest\Run\DriverTestTasks.dll" /select:"@Name='DriverTestTasks::_DriverRemoval'" /p:"InfFile=Test7KMDF_vs2015_u2.inf" /p:"Debug=1" /p:"ImportDriver=1" /p:"RemoveDriver=1" /p:"CertificateFile=Test7KMDF_vs2015_u2.cer" /p:"PackageGuid=x64" /p:"HardwareId=Root\Test7KMDF_vs2015_u2" /rebootStateFile:%SystemDrive%\DriverTest\Run\DriverTestReboot.xml /enableWttLogging /wttDeviceString:$LogFile:file="%SystemDrive%\DriverTest\Run\Driver_Removal_00016.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*" /runas:Elevated
    [14:51:36:544]: Result Summary: Total=1, Passed=1, Failed=0, Blocked=0, Warned=0, Skipped=0
    [14:51:36:544]: Task "Driver Removal" completed successfully
    [14:51:37:215]: Driver Preparation
    [14:51:37:215]: Removing any existing files from test execution folder.
    [14:51:37:262]: Copying required files for "Driver Preparation".
    
    $KitRoot$\Testing\Runtimes\TAEF\te.exe "%SystemDrive%\DriverTest\Run\DriverTestTasks.dll" /select:"@Name='DriverTestTasks::_DriverPreparation'" /p:"InfFile=Test7KMDF_vs2015_u2.inf" /p:"Debug=1" /p:"ImportDriver=1" /p:"RemoveDriver=1" /p:"CertificateFile=Test7KMDF_vs2015_u2.cer" /p:"PackageGuid=x64" /p:"HardwareId=Root\Test7KMDF_vs2015_u2" /rebootStateFile:%SystemDrive%\DriverTest\Run\DriverTestReboot.xml /enableWttLogging /wttDeviceString:$LogFile:file="%SystemDrive%\DriverTest\Run\Driver_Preparation_00016.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*" /runas:Elevated
    [14:51:48:934]: Result Summary: Total=1, Passed=1, Failed=0, Blocked=0, Warned=0, Skipped=0
    [14:51:48:934]: Task "Driver Preparation" completed successfully
    [14:51:49:622]: Driver Install
    [14:51:49:622]: Removing any existing files from test execution folder.
    [14:51:49:763]: Copying required files for "Driver Install".
    
    $KitRoot$\Testing\Runtimes\TAEF\te.exe "%SystemDrive%\DriverTest\Run\DriverTestTasks.dll" /select:"@Name='DriverTestTasks::_RunProcess'" /p:"BinaryPath=%SystemDrive%\DriverTest\devcon.exe" /p:"Arguments=-f install %SystemDrive%\DriverTest\Drivers\Test7KMDF_vs2015_u2.inf Root\Test7KMDF_vs2015_u2" /p:"WorkingFolder=%SystemDrive%\DriverTest\Drivers" /rebootStateFile:%SystemDrive%\DriverTest\Run\DriverTestReboot.xml /enableWttLogging /wttDeviceString:$LogFile:file="%SystemDrive%\DriverTest\Run\Driver_Install_00008.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*" /runas:Elevated
    [14:51:58:653]: Result Summary: Total=1, Passed=1, Failed=0, Blocked=0, Warned=0, Skipped=0
    [14:51:58:653]: Task "Driver Install" completed successfully
    [14:51:59:028]: Driver Post Install Actions
    [14:51:59:028]: Removing any existing files from test execution folder.
    [14:51:59:075]: Copying required files for "Driver Post Install Actions".
    
    $KitRoot$\Testing\Runtimes\TAEF\te.exe "%SystemDrive%\DriverTest\Run\DriverTestTasks.dll" /select:"@Name='DriverTestTasks::_DriverPostInstall'" /rebootStateFile:%SystemDrive%\DriverTest\Run\DriverTestReboot.xml /enableWttLogging /wttDeviceString:$LogFile:file="%SystemDrive%\DriverTest\Run\Driver_Post_Install_Actions_00017.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*" /runas:Elevated
    [14:52:07:560]: Result Summary: Total=1, Passed=1, Failed=0, Blocked=0, Warned=0, Skipped=0
    [14:52:07:575]: Task "Driver Post Install Actions" completed successfully

    Monday, June 6, 2016 11:14 AM

All replies

  • This means deployment completed successfully, but the debugger is not connected for some reason. With kernel mode debugger, the appearance of debugger window just indicates that it is listening to the transport you chose while provisioning. Only when the target responds, you can break into the debugger.

    This issue could be due to a firewall settings if you are using network debugging. On a successful kernel debugger connection, you should see a similar message on the debugger window:

    Using NET for debugging
    Opened WinSock 2.0
    Waiting to reconnect...
    Connected to target 169.254.97.160 on port 50002 on local IP 169.254.97.10.

    Alternately, try using the kernel debugger settings of the target with WinDbg and see if that works.


    Ajay Barboza

    Tuesday, June 7, 2016 9:52 PM
  • hi, Ajay :
    I have two questions to ask you, thanks very much for your reply. 

    Question 1:
    Whenever I press F5 to create a debug session via Ethernet network, the prompt messsage "connected to target 192.168.1.5 on port 50228 on local IP 192.168.1.6" sometimes appears as code-(A) location、sometimes appears as code-(B) location、sometimes appears as code-(C) location、sometines it even doesn't appear. This situation is normal or un-normal ???  thanks

    note: According to my experience, if this prompt messsage has appeared, denote that this time's debug session will be successful, so break-ll/F5 functions are also normal. If this prompt messsage doesn't appear, denote that this time's debug session will be failure, so break-all/F5 functions will can't use.

    Question 2:
    The second question is about breakpoint hit rate's issue. I set multiple source lines' breakpoints in DriverEntry() and Unload() function. and in target site's device-manager, I operate continuously the driver's stop/resume function, but breakpoints not every time can hit in DriverEntry()/Unload() function. Sometimes breakpoints can hit in DriverEntry()/Unload(), sometimes breakpoints can't hit in DriverEntry()/Unload(). Even if breakpoint can hit in DriverEntry()/Unload()'s certain source line(assume in Line10), it also possible to un-hit in next line line11 in which I also set a breakpoint. About breakpoints' behavior mentioned above, this is normal or nu-normal in visual studio driver development envirnment ???

    note : Windows 10 pro is installed in target computer, Window 8.1 home is installed in host computer, and visual studio 2015 with WDK10 is used via Ethernet network to connect target and host notebooks.

    (A)
    
    Microsoft (R) Windows Debugger Version 6.3.9600.17336 AMD64
    Copyright (c) Microsoft Corporation. All rights reserved.
    
    Using NET for debugging
    Opened WinSock 2.0
    Waiting to reconnect...
    Connected to target 192.168.1.5 on port 50594 on local IP 169.168.1.6
    [15:54:10:327]: Remove Existing Remote Package
    [15:54:10:355]: Task "Remove Existing Remote Package" completed successfully
    [15:54:10:372]: Copy Driver Package
    [15:54:10:488]: Task "Copy Driver Package" completed successfully
    [15:54:10:503]: Driver Removal
    [15:54:10:504]: Removing any existing files from test execution folder. 
    ..........................
    ..........................
    
    ==============================================  
    
    (B)
    
    Microsoft (R) Windows Debugger Version 6.3.9600.17336 AMD64
    Copyright (c) Microsoft Corporation. All rights reserved.
    
    Using NET for debugging
    Opened WinSock 2.0
    Waiting to reconnect...
    [16:52:58:212]: Remove Existing Remote Package
    [16:52:58:223]: Task "Remove Existing Remote Package" completed successfully
    [16:52:58:239]: Copy Driver Package
    [16:52:58:369]: Task "Copy Driver Package" completed successfully
    [16:52:58:382]: Driver Removal
    [16:52:58:383]: Removing any existing files from test execution folder.
    [16:52:58:411]: Copying required files for "Driver Removal".
    Connected to target 192.168.1.5 on port 50228 on local IP 169.168.1.6
    
    $KitRoot$\Testing\Runtimes\TAEF\te.exe "%SystemDrive%\DriverTest\Run\DriverTestTasks.dl"
    ..........................
    ..........................
    
    =============================================
    
    (C)
    
    Microsoft (R) Windows Debugger Version 6.3.9600.17336 AMD64
    Copyright (c) Microsoft Corporation. All rights reserved.
    
    Using NET for debugging
    Opened WinSock 2.0
    Waiting to reconnect...
    [17:05:49:670]: Remove Existing Remote Package
    [17:05:49:686]: Task "Remove Existing Remote Package" completed successfully
    [17:05:49:702]: Copy Driver Package
    [17:05:49:811]: Task "Copy Driver Package" completed successfully
    [17:05:49:827]: Driver Removal
    [17:05:49:827]: Removing any existing files from test execution folder.
    [17:05:49:858]: Copying required files for "Driver Removal".
    
    $KitRoot$\Testing\Runtimes\TAEF\te.exe "%SystemDrive%\DriverTest\Run\DriverTestTasks.dl"
    Connected to target 192.168.1.5 on port 50228 on local IP 169.168.1.6
    [17:06:19:218]: Result Summary: Total=1, Passed=1, Failed=0, Blocked=0, Warned=0, Skipped=05
    ..........................
    ..........................
    
    
    
    
     

    Wednesday, December 14, 2016 11:25 AM
  • Most experienced driver writers use WinDBG rather that the VS debugger.  Some of this is history (we have been developing since before Microsoft supported driver development in VS), but a lot of this is reliability.  In general, the deployment and debugging in the WDK under Visual Studio is problematic at best.  If you have been taking weeks as you indicated, try moving to WinDbg, and use .kdfiles to ensure the latest driver is installed.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Wednesday, December 14, 2016 1:10 PM