4 Replies Latest reply on Jan 31, 2009 12:53 AM by simplesteps3

    Issue on uninstalling CodeAnalyst


      We have a dev PC, with Visual Studio 2005 (no service pack). The PC is a dual-dual Opteron 275 PC, Windows XP Pro SP2 (not yet SP3).

      I downloaded and installed CodeAnalyst_Public_2.84.512.0356.exe. I spent a day or two experimenting with it, trying to get to grips with using it. However, I later had to uninstall it - at the request of a colleague.

      Once uninstalled, we had trouble running a debug session in VS2005. It came up with a message saying it was unable to find MSDIA80.DLL. A bit of Googling came up with the following Microsoft support page:

      I gather the missing DLL is part of VC2005 install, and is a critical part of the debugging functionality of VC2005.

      MSDIA80.DLL was still in its expected location. Following the MS note, I did:
      regsvr32 C:\Program Files\Common Files\Microsoft Shared\VC\msdia80.dll

      On retrying a debug session (either stepping into, or just "F5-running" it), the error dialog no longer appears, but VS2005 sits there completely unresponsive - as if its unable to initiate the debugger.

      So it appears that uninstalling CodeAnalyst broke the VS2005 debugger. Could someone confirm whether this is possible and if there is a work-around?

      I have resorted to reinstalling VS2005 now in an attempt to get it working again.

      We aren't in a position to upgrade VS2005 SP1 yet and the older versions of CodeAnalyst (which perhaps cooperate better?) don't appear to be available on the AMD website.

      I happen to have an older version of it to hand (CodeAnalyst_Beta_Public_2.69.248.0115.exe) - downloaded ages ago and not used - though I'm now reluctant to trying it, for fear of the above problems reappearing if I try to uninstall it.

      I am keen to make use of CodeAnalyst and promote its use within our team, and the problem I encountered above has put it in a negative light amongst my colleagues!

      Thanks in advance,

      Martyn Dodsworth

        • Issue on uninstalling CodeAnalyst
          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:
          _NT_SYMBOL_PATH=SRV*C:\Program Files\AMD\CodeAnalyst\bin\symbols*http://msdl.microsoft.com/download/symbols

          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!


          Martyn Dodsworth

          • Issue on uninstalling CodeAnalyst

            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.

              • Issue on uninstalling CodeAnalyst
                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\msdia20.dll
                C:\Program Files\AMD\CodeAnalyst\bin\qt-mt333.dll
                C:\Program Files\AMD\CodeAnalyst\bin\CASplash.png
                C:\Program Files\AMD\CodeAnalyst\bin\CAToolBar.dll
                C:\Program Files\AMD\CodeAnalyst\bin\en-us\CAToolBar.resources.dll
                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!