debuggingwindbgdebug-symbolswindb

WinDBG not able to read symbol path string set with the _NT_SYMBOL_PATH environment variable


I have set the environment variable _NT_SYMBOL_PATH to the below value

SRV*C:\My\Sym*http://msdl.microsoft.com/download/symbols

I have also made sure that the directory C:\My\Sym actually does exist. However when I start up WinDBG it does not pick up the Symbol path string I have setup in the _NT_SYMBOL_PATH environment variable. The symbol path in WinDBG is empty.

When I check the environment variable from the command line, I can see the above environment variable set correctly.

I don't understand what I am missing. Can anyone please help? I know that I can set the path in WinDBG directly but I am interested in understanding why the environment variable is not working.


Solution

  • I solved the problem by myself. This should be useful to anyone who encounters this issue.

    I was trying to do the following.

    1. Installed Window Debugging Tools on my fresh laptop.
    2. Set the _NT_SYMBOL_PATH environment variable.
    3. Spinned up WinDBG and clicked on File -> Symbol File Path to bring up the Symbol Search Path. I was expecting the symbol search string I specified in the environment variable to show up here.

    Note: I did not start a WinDBG session.

    Solution: Start WinDBG session by debugging anything. I debugged C:\Window\System32\Notepad.exe which I think forces WinDBG to load the string from the environment variable. I then opened the Symbol Search Dialog again by clicking File -> Symbol File Path

    VOILA !!! Now I can see the string populated.

    Conclusion: WinDBG does not populate the Symbol Search dialog unless you start debugging something.