2

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 exists. However when I start up WinDBG it does not pickup the Symbol path string I have setup in the _NT_SYMBOL_PATH environmet variable. The symbol path in WinDBG is empty.

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

I don't understand what am I 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.

Tushar Jadhav
  • 335
  • 4
  • 14
  • number of possibilities, the path is invalid, in which case windbg will ignore it (most likely), you have started windbg with flag `-sins' which will ignore your symbol server path (unlikely), does it work if you set the sybol path within WinDbg and save your workspace? I don't see anything in particular that is wrong with your symbol path by the way so it is a little odd – EdChum Sep 05 '13 at 11:13
  • 1
    Use a tool to inspect the environment variables of windbg. For ex, a second instance of windbg attached to the first and issue `!peb`. Or use Process Explorer to view windbg's environment variables. Also, make sure you run windbg from the command line that has the environment variable already set. If you manually set the env var from the cmd line but then start windbg using explorer, then windbg will not have the env var set. – Marc Sherman Sep 05 '13 at 12:50
  • I saw from process explorer and process monitor and the environment variable seems to be present. Also like I said before the path is correct and does exists physically on my computer. Still have no idea why it works. I have set the environment variable from right click"My Computer" -> Properties -> Advanced System Settings ->Environment Variables and even restarted my machine after setting it(though not required) to make sure that the environment variable kicks in. Problem is still unresolved. – Tushar Jadhav Sep 05 '13 at 20:22
  • I am adamant about making it work through environment variable so that I don't have to set the symbol for each debugging tool. Interestingly Process Explorer and Process Monitor seem to pick up the environment variable. – Tushar Jadhav Sep 05 '13 at 20:26

1 Answers1

3

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.

Tushar Jadhav
  • 335
  • 4
  • 14