I’m writing a VS extension that needs to know the full path of the file the user is currently debugging, and I want to support the scenario where the source path written in the pdb is not correct, and the user is prompted to find the file elsewhere.
If I do the following:
1) Debug a DLL whose PDB points at code file at location A
2) Move the code file to different location, B
3) When prompted with the Open File dialog, direct the debugger to locate the code at location B
The file is then opened, and it seems Visual Studio “remembers” this redirection and will know to look for the file in location B even after I restart it.
My problem is, that the IDebugStackFrame2/EnvDTE.StackFrame objects both give me the old, incorrect path for the code file – and I want the correct one so I can read the source from it! Does Visual Studio expose this indirection table in any way?
How can I get the text of the source file?
P.S. I tried to use the VsShellUtilities.OpenDocument method with the old, incorrect path, but it throws a file not found method..
Simply can’t be done……….