How to update the source location in symbol (.pdb) files

What I am trying to do is run a batch script to update .pdb files to point to a different source location. I'm not sure if there is a way to update the absolute paths in the pdb file, but currently I'm looking into inserting a source stream into the pdb file so the debugger can get the source files.

I am inserting a source stream using pdbstr.exe:

pdbstr -w -i:c:testpdbstream.txt -p:"C:testsomelibrary.pdb" -s:srcrv

The pdbstream.txt contents are pretty basic:

SRCSRV: ini ------------------------------------------------
VERSION=1
SRCSRV: variables ------------------------------------------
SRCSRVTRG=%var1%
SRCSRVCMD=cmd echo %var1% >> c:testoutput.txt
SRCSRV: source files ---------------------------------------
C:somedifferentpathsomelibrarysourcesfirstclass.cs
C:somedifferentpathsomelibrarysourcessecondclass.cs
SRCSRV: end ------------------------------------------------

According to the info on MSDN I added only the required parameters. To my understanding, this should run the command in the SRCSRVCMD variable when the debugger loads the pdb file and searches for the source files. So I would expect some output in c:testoutput.txt.

I have verified that the correct pdb file is loaded for the module, but when i'm debugging in Visual Studio it does not find any source file. The output shows:

"SRCSRV: The module 'C:testsomelibrary.dll' does not contain source server information."

Is the source stream not valid, or am I simply overlooking a particular step? Or can I change the absolute source location in the pdb file without inserting a datastream?

Edit

To clarify, I am currently using the Visual Studio debugger. The code I am trying to debug is in private libraries I created myself. I want the .pdb files to point to the correct source files after everything (dll, pdb & source files) is moved to a different location on disk.

链接地址: http://www.djcxy.com/p/12940.html

上一篇: 从TextView中的链接中删除下划线

下一篇: 如何更新符号(.pdb)文件中的源位置