This content has been marked as final. Show 4 replies
Ok, looks like I found a workaround - after quite a bit of investigation.
I tried reinstalling VS2005, using the repair option (i.e. not a complete uninstall/reinstall). That didn't work - it still hung when starting a debug session.
While VS2005 was reinstalling, I checked the folder in "Program Files" and found a CodeAnalyst folder still present - containing MSDIA20.DLL, amongst other stuff left behind - including some projects and a symbols folder (as I had enabled the symbol download env variable in the CA settings dialog).
I searched the registry for "MSDIA" and found a load of references to the CodeAnalyst installation - including MSDIA20.DLL still being registered with several different CLSIDs - as well as the MSDIA80.DLL installed by VS2005.
Clearly CodeAnalyst is leaving behind registry entries which it created, after uninstallation.
Now there may be good reasons for this, but it broke VS2005 debugging - with a reported missing MSDIA80.DLL (as I reported in my last post).
I tried unregistering MSDIA20.DLL, using "regsvr32 /u" and those registry entries relating to MSDIA20.DLL disappeared:
regsvr32 /u "C:\Program Files\AMD\CodeAnalyst\bin\msdia20.dll"
I also did a "regsvr32" to re-register the VS8 MSDIA80.DLL - for good measure.
regsvr32 "C:\Program Files\Microsoft Visual Studio 8\Common7\Packages\Debugger\msdia80.dll"
Unfortunately, restarting VS2005 and doing a debug session still hung as before.
Then I noticed that when VS2005 was hanging, the status bar at the bottom said it was loading symbols for the a particular third-party dll which we're using. I think there are no symbols available for this DLL - and they would be unlikely to be on the Microsoft symbol server.
Then I recalled that I had set set CodeAnalyst to download symbols, and that they were being put in a subfolder in the CodeAnalyst installation. Those symbols were still there, and also there was an environment variable still set, pointing to that symbol folder:
I do know that _NT_SYMBOL_PATH is also used by VS2005 to download symbols (if the env variable is set). I was not previously using this env variable, so it wasn't set at all, prior to using CA. So while it had been set from inside CA, it was then affecting VS2005.
So I quickly realised that VS2005 was "hanging" on initiating a debug session as it was trying to download symbols for the third-party DLL we're using - which doesn't exist on the MS symbol server.
So I removed the env variable, restarted VS2005 and fired up a debug session and it worked!
Admittedly, I hadn't tried to fire up a debug session from VS2005 while CodeAnalyst was running (as I was using it to profile an executable app, rather than debug it).
With hindsight, I suspect that it would still have hung, even while CA was still installed, due to the missing symbols (though why VS2005 should have hung and not just timed out is beyond me - perhaps it would have woken up eventually if I had left it to mull it over for a while!).
So the lesson for me here is that CodeAnalyst doesn't touch the _NT_SYMBOL_PATH env variable on uninstallation - even if it set its value during install.
I suggest that perhaps CA should display a warning about this to the user on uninstall?
Regardless of the symbol issue - the earlier issue still stands: CodeAnalyst (at least the latest I used: 2.84.512.0356) is apparently doing something with the Microsoft MSDIA debug API, which VS2005 uses. On uninstallation, its not restoring whatever it did, such that debugging in VS2005 (no service pack) is then broken. Apparently the workaround being that you have to re-register MSDIA80.DLL (and possibly de-register MSDIA20.DLL) using regsvr32.
I now have a working Visual Studio 2005 debugger once more, but this has caused a bit of down-time for myself and my colleague.
Perhaps this issue only affected us as we're still using vanilla VS2005 without service pack. I plan to push for our team to upgrade to VS2005 SP1 - so perhaps this will be a good reason...
Hopefully this postmortem might help someone else out there...
I regard CodeAnalyst as an impressive and useful tool, and I shall continue learning to use it - and hopefully AMD will continue the good work and improve it!
THank you very much for your investigation and detailed description.
CodeAnalyst 2.84 does not install MSDIA20.dll.
We will wrok on the MSDIA80.dll registery issue. It seems like if VS 2005 installed, CodeAnalyst does not need to install MSDIA80.dll.
We will change the way we use the symbol server path issue. Most likely CodeAnalyst will not use environment variable, "_NT_SYMBOL_PATH" to specify path.
Appreciate your feedback.
Following uninstallation of CA, I had a look at the installation folder, which was still present, to see what was left behind. I found msdia20.dll at the following location, along with various other files:
C:\Program Files\AMD\CodeAnalyst\bin\symbols [containing symbols downloaded so far]
If CA didn't install it, then I'm not sure how it got there. Maybe it have was installed by an earlier version of CA? (I'm not sure of the history of the particular dev PC in question).
As for MSDIA - I gather its an API for getting at the debug information in pdb symbol files (since the file format changes across Visual Studio versions). MSDIA80.DLL, its certainly part of the vanilla VC2005 installation, as there is an instance of it here:
C:\Program Files\Microsoft Visual Studio 8\Common7\Packages\Debugger\msdia80.dll
CA should certainly not break VS2005 debugging - both while its installed and after its uninstalled. Perhaps its an issue that doesn't occur with VS2005 SP1 and/or VS2008 - and only happens with vanilla VS2005?
Many thanks for getting back!
I've been running into this same issue as well, has an SP2 been released?