Discussion:
Resyncing EXE and PDB
(too old to reply)
Dave Burns
2008-11-25 20:59:59 UTC
Permalink
I often run into a situation where I receive a minidump file from a
customer, but the EXE & PDB on the machine I am using to debug the minidump
file were built on a different date than the EXE on the customer's machine,
even though the source files were identical.

The debugger, whether Windbg or any version of Visual Studio complains that
the symbols do not match.

Is there any way to 'tweak' something in the minidump file or the PDB file,
using a hex editor for instance, so that I can debug it?

Thanks, Dave
Hongye Sun [MSFT]
2008-11-26 05:23:50 UTC
Permalink
Hi Dave,

Thanks for using Microsoft Newsgroup Service. My name is Hongye Sun[MSFT]
and it is my pleasure to work with you on this issue.

Each build of the EXE and PDB files generates different GUID and save it
into both EXE and PDB files, even though the source code is the same. By
default, debugger will check the GUID to verify if they are matched.
However, we can change this default behavior of the debugger in Windbg. To
do that, please follow the detailed steps:

1. Open windbg and load the minidump
2. Type "symopt +40" to add symbol option "SYMOPT_LOAD_ANYTHING" to reduce
the pickiness of the symbol handler.
3. Type "!sym noisy" to activate noisy symbol loading.
4. Type "ld <EXE name>" to load the symbols of the EXE module, and it shows
the detailed information.
5. To verify if the symbol has been loaded, try "ld <EXE name>" command
again, it will show you that the symbol has been loaded message.

I also provide methods to view the GUID in EXE and PDB file here.

To view EXE GUID:
1. Open windbg and load the minidump
2. Type "!lmi <EXE name>", it will list all the information of the EXE
module.
3. Find "RSDS - GUID".

To view PDB GUID:
1. Open command prompt and change directory to Windbg folder.
2. Type "DBH <PDB file path>".
3. Type "info" which lists all the symbol info in a PDB file
4. Find "PdbSig70" field and it shows you the GUID value.

Following is all the documentation about the commands and tools that I
mentioned above:
SYMOPT_LOAD_ANYTHING
(http://msdn.microsoft.com/en-us/library/cc266462.aspx#df594b86-a965-4f24-af
54-e967fe57c9e7)
DBH tool (http://msdn.microsoft.com/en-us/library/cc501192.aspx)
!sym noisy (http://msdn.microsoft.com/en-us/library/cc266950.aspx)
!lmi (http://msdn.microsoft.com/en-us/library/cc266934.aspx)

Please have a try of the steps above and let us know if it works for you,
thanks.

Regards,
Hongye Sun (***@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
***@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Jochen Kalmbach [MVP]
2008-11-26 06:59:25 UTC
Permalink
Hi Dave!
Post by Dave Burns
I often run into a situation where I receive a minidump file from a
customer, but the EXE & PDB on the machine I am using to debug the minidump
file were built on a different date than the EXE on the customer's machine,
even though the source files were identical.
I suggest, that you use "symstore" to save your EXE/PDB in a
network-share (or any other directory).
Then WinDBg and VS* will *automatically* find the correct version of
your PDB/EXE!
You only need to set the "_NT_SYMBOL_PATH" environment-variable to:
SRV*c:\websymbols*http://msdl.microsoft.com/download/symbols;SRV*\\server\builds

(where "\\server\builds" is your network-share or local directory).
Post by Dave Burns
The debugger, whether Windbg or any version of Visual Studio complains that
the symbols do not match.
Yes. Therefor, use the "symstore" program from "Debugging Tools for
Windows" and then you don't have this problem anymore.
Post by Dave Burns
Is there any way to 'tweak' something in the minidump file or the PDB file,
using a hex editor for instance, so that I can debug it?
In WinDbg you can use ".symopt+ 0x40" like already suggested. But I
prefer to use automatically the "correct" PDB/EXE..


You also can combine this with source-indexing which will also
autamatically retrive the "correct" source-code to the PDBs ;)


See thread in "news:microsoft.public.windbg" with the name "Minidumps
and source indexing".

Greetings
Jochen
j***@cix.compulink.co.uk
2008-11-27 21:21:49 UTC
Permalink
Post by Jochen Kalmbach [MVP]
I suggest, that you use "symstore" to save your EXE/PDB in a
network-share (or any other directory).
Saving your EXEs and PDBs has other uses, too. We save every version
that we ship, of course, but also every overnight integration/testing
build.

This allows you to find out when bugs were introduced by running the
saved builds, and seeing which one is the first with the break. This
then cuts down the number of source changes that have to be looked at
anew.
--
John Dallman ***@cix.co.uk
"C++ - the FORTRAN of the early 21st century."
Hongye Sun [MSFT]
2008-12-24 06:06:35 UTC
Permalink
Hi Dave,

I have not heard from you for many days. Have you tried my suggestion in my
last reply? I am writing to follow up this issue and check if you need any
further help on that. Do you mind letting us know the current status of the
issue? Thanks.

Have a great holiday.

Regards,
Hongye Sun (***@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
***@microsoft.com.
 
This posting is provided "AS IS" with no warranties, and confers no rights.
Loading...