views:

39

answers:

3

Assume i have a custom service written in VC++ 6.0 and i have shipped it as part of a particular release. Unfortunately i did not take the pdb while building the binary.

At a later point of time my customer reported a crash and i had to get the pdb to identify the crash cause. Will a pdb that i take now be enough to identify the point of crash.

In other words i have taken binary and pdb separately however i did not make any changes to the sourcecode after taking the binary.

My understanding is that even thought he symbols wont match in terms of date and time when they were built but in terms of the content it will match.

Is my understanding correct?

+1  A: 

Yes, that should still work without a problem (though, if memory serves, you can expect a warning about the mismatched time-stamps).

Jerry Coffin
Yes i have seen the warning in windbg. But the bottomline is it will work.
ckv
@ckv: I suppose there *might* be some dark corner where things don't work, but it seemed to handle everything I needed anyway.
Jerry Coffin
@Jerry: Thats why i thought of seeking expert opinion from SO users here.
ckv
@ckv: A reasonable idea, but the sort of thing that's hard for anybody to confirm with absolute certainty. I certainly never made any attempt at doing a full regression test on Windbg with a PDB file generated this way -- and I'd be a bit surprised of anybody else has either.
Jerry Coffin
+1  A: 

You'll need to make sure you compiled with exactly the same compiler version (patches could change code generation and addresses), set of compiler/linker options, the same library versions as well as the same source to make sure the addresses match. If you're able to do that then you should be able to take a pdb generated later.

However even if it doesn't match exactly it's possible that it gets you close enough to see the bug by inspection.

Mark B
Hmm Ok i understand what you are trying to say. Thanks.
ckv
And this still won't work if the code uses the `__DATE__` macro in interesting ways.
MSalters
A: 

The .pdb and the binary should be able to work together perfectly if the were built from the same source code even if not at the same time. However you will not be able to load this in any debugger. For example, the Visual Studio debugger will refuse to load it because it will say they are mismatched.

You need a debugger that can accept mismatched symbols such as WinDbg. To load with mismatched symbols type the magic command symopt +0x40.

crazyx