Debug symbols not loading when built on another machine

B

Bardo

Hi all,

We are trying to debug an assembly which was built in debug configuration on
our build server. The output window of visual studio indicates that no
symbols are being loaded for the assembly.
However, when the PDB file is copied alongside the dll, the symbols load ok.
We were a little confused, because we had already been debugging this
assembly WITHOUT copying the pdb file.
What I discovered was that when the assembly is built on the machine that is
being used to attach to and debug the process, the symbols load fine. When
the assembly is built on another workstation, whether that be the build
server or another developers workstation, the pdb file needs to sit
alongside the dll for the symbols to load.
I did a binary compare of the 2 assemblies (same source, different build
workstations), and there is only something like 23 bytes difference.
Questions:
1. Can anyone please shed some light on what is going on here?!
2. Are there some good articles on what is loaded as "symbols". i.e. more
insight into what is going on at a lower level here.
3. It seems debug information is embedded into the debug version dll file,
and also externally stored in the pdb file. Otherwise how can the debug dll
be debugged at all without a pdb file?

Cheers very much,

Bardo
 
C

Carl Daniel [VC++ MVP]

Bardo said:
Hi all,

We are trying to debug an assembly which was built in debug
configuration on our build server. The output window of visual
studio indicates that no symbols are being loaded for the assembly.
However, when the PDB file is copied alongside the dll, the symbols
load ok. We were a little confused, because we had already been
debugging this assembly WITHOUT copying the pdb file.
What I discovered was that when the assembly is built on the machine
that is being used to attach to and debug the process, the symbols
load fine. When the assembly is built on another workstation,
whether that be the build server or another developers workstation,
the pdb file needs to sit alongside the dll for the symbols to load.
I did a binary compare of the 2 assemblies (same source, different
build workstations), and there is only something like 23 bytes
difference. Questions:
1. Can anyone please shed some light on what is going on here?!
2. Are there some good articles on what is loaded as "symbols". i.e.
more insight into what is going on at a lower level here.
3. It seems debug information is embedded into the debug version dll
file, and also externally stored in the pdb file. Otherwise how can
the debug dll be debugged at all without a pdb file?

Debug info is stored in the PDB file only. The brinary (DLL or EXE)
contains the absolute path to the location where the PDB file was when the
DLL was built. The debugger tries to load the PDB file from that absolute
path or from the same directory as the DLL/EXE. The DLL/EXE also contains a
timestamp which is replicated in the PDB file - if the timestamps don't
match, the PDB won't be loaded.

-cd
 
B

Bardo

Hi Carl,

thanks for the reply. That fits in with what we are experiencing.
Although I can envisage a number of issues when trying to debug assemblies
that are deployed via script to the local GAC from the build server! This
means we will need to manually copy the PDB file for each assembly GAC'd,
which also means determining the version to know where to copy the file
based on the GAC directory structure.
Is there some common way of doing this sort of thing?
I saw that you can have a "Symbol Server" and point your VS2005 solution at
a common directory etc. Not sure what happens though when you end up with
symbols on both local machine (from debugging sessions) and also on the
build server...
Do you have any thoughts on this at all? Or am I going down the wrong path?

Cheers,

Bardo
 
C

Carl Daniel [VC++ MVP]

Bardo said:
Hi Carl,

thanks for the reply. That fits in with what we are experiencing.
Although I can envisage a number of issues when trying to debug
assemblies that are deployed via script to the local GAC from the
build server! This means we will need to manually copy the PDB file
for each assembly GAC'd, which also means determining the version to
know where to copy the file based on the GAC directory structure.
Is there some common way of doing this sort of thing?
I saw that you can have a "Symbol Server" and point your VS2005
solution at a common directory etc. Not sure what happens though when
you end up with symbols on both local machine (from debugging
sessions) and also on the build server...
Do you have any thoughts on this at all? Or am I going down the wrong
path?

I haven't played with the symbol server, but my understanding is that you
can set up a local symbol server, configure your VS installations to point
to it, and deploy your PDB files to the symbol server as part of your
build/distribution process, so it might work well in your situation.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top