Visual Studio Developer Center > Visual Studio Forums > Visual Studio Debugger > Changing pdbpath in binary file header information
Ask a questionAsk a question
 

QuestionChanging pdbpath in binary file header information

  • Friday, October 30, 2009 4:31 PMAleksas Pielikis Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    Is there a way to change path to pdb file in binary file from full path to relative? 
    I mean both for managed libraries and unmanaged.

    If i do dumpbin /headers on my library file i get:
            Time Type       Size      RVA  Pointer
        -------- ------ -------- -------- --------
        4AE9A239 cv           4F 0001A9A8    197A8    Format: RSDS, {7B0C89D0-69E1-4A12-817C-424F209FAB10}, 1, D:\Projects\My Application\workspace\bin\Win32_x86\Release\MyLib.pd
    b
    Instead of "D:\Projects\My Application\workspace\bin\Win32_x86\Release\MyLib.pdb" I would like to have something like "bin\Win32_x86\Release\MyLib.pdb" or just "MyLib.pdb"

    Thanks

All Replies

  • Monday, November 02, 2009 11:02 AMRoahn LuoMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello Alex,

    I'm not sure why you need to change it to relative path. If we have to give those files to our customers, for managed libraries, the .pdb file contains only source file names and their lines as well as the lacal variable names, hence, it is safe to give them to customers. For the native libraries, there are more information contained (for more information, please refer to this article.) However, we could change the information with the Symbol APIs.

    Best regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
  • Monday, November 02, 2009 12:40 PMAleksas Pielikis Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thanks for reply, 

    "Symbol APIs" link that you provided is for pdb editing, but I was talking about changing the path to MyLib.pdb inside header information of MyLib.dll.
    Our company doesn't provide symbols to our customers so pdb file containment is not the problem.

    Main reason for changing the path in MyLib.dll header information is keeping files provided to customers tidy. Information which is stored in MyLib.dll about the location of pdb file is totally useless since I do nightly builds and store pdb files in symbol store. 

  • Tuesday, November 03, 2009 9:53 AMLei Shi Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
  • Wednesday, November 04, 2009 10:21 AMAleksas Pielikis Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    There is a linker parameter for C projects "/pdbpath:none" which does what i was searching for. But this solves the problem only for unmanaged libraries. Can't find similar solution for c# projects.