Support for windows 8 and WDK in PowerDbg

Oct 10, 2012 at 12:44 PM
Edited Oct 10, 2012 at 12:48 PM

In windows 8 debugging tools for windows comes in a new form called WDK.

The home directory of the good old tools is now : C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64 (for the 64 bit version) and C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x86 (for the 32 bit version)Unfortunately the PowerDbg module does not know that. 

When loading the module it looks for the home directory of "debugging tools for windows" and put it in a global variable. ($debuggerRoot)

We have to change the module file and add the correct directories.

So open the module file (PowerDbg.psm1) and change the function Get-DbgToolsLocation (line 428) so serach path will include the correct folders:

 $searchPaths =  "$env:programfiles\Debugging Tools for Windows (x64)",
"$env:programfiles\Debugging Tools for Windows (x86)",
"$env:programfiles (x86)\Windows Kits\8.0\Debuggers\x64", #windows 8
"$env:programfiles (x86)\Windows Kits\8.0\Debuggers\x86", #windows 8
 
"C:\debuggers"  # for Microsoft internal installs

As we can see from the code PowerDbg works with only one version at a time. (The first folder in the list) 
To switch between x64 and x86 we have to change the order of the folder in the list. I think that a parameter should control that. (TBD)

Manu 

Developer
Feb 8, 2014 at 8:43 AM
I am still getting error :(

__Debugging Tools not located.
Supply 'debuggerRoot' ___parameter explicitly,
or set the DebuggingTools envir___onment variable.
At C:\Users\mullick\Documents\WindowsPowerShell\Modules\PowerDbg\PowerDbg.psm1:451 char:13
  • throw @"
  • ~~~~~~~~
    • CategoryInfo : OperationStopped: (Debugging Tools...nment variable.:String) [], RuntimeException
    • FullyQualifiedErrorId : Debugging Tools not located.
      Supply 'debuggerRoot' parameter explicitly,
      or set the DebuggingTools environment variable.
Import-Module : The specified module 'PowerDbg' was not loaded because no valid module file was found in any module directory.
At line:1 char:1
  • Import-Module PowerDbg
  • ~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : ResourceUnavailable: (PowerDbg:String) [Import-Module], FileNotFoundException
    • FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand__
Developer
Feb 19, 2015 at 1:24 AM
Working now.