Debugging question

J

Jon Brunson

Where does VS.NET 2003 load the symbol (pdb) files from when debugging a
smart device?

I've got a DLL in a sub-folder off where my main exe lives, and I can
never debug this DLL as it never loads its symbols.
Does the pdb file have to be on the device, or on the PC? In the same
folder as the EXE?
If so is there an automated way to copy the pdb file from the sub-folder
to the main folder after each build?
Does that fact I'm loading this DLL at run-time effect where the pdb
file needs to go in order to debug?

On a side note, I load DLLs at run-time in a Desktop application, and
they debug fine.
 
P

Paul G. Tobey [eMVP]

You can't debug *any* native code from VS.NET, at this time. If the DLL is
a managed code DLL, its debug information will be loaded from the PC
location where the reference in the EXE project points to...

Paul T.
 
J

Jon Brunson

It is a managed DLL (VB.NET), but I don't reference it, I load it at
runtime using Assembly.LoadFrom().
Obviously the LoadFrom() points to a DLL on the smart device, so is it
even possible to load the symbols for such a file?
 
P

Paul G. Tobey [eMVP]

It should be, but I don't know what the rules are for VS.NET to look for the
symbols. I'd be shocked if it was looking on the device, though...

Paul T.
 
J

Jon Brunson

Do you know anyone that would know? Someone I could perhaps email to
find out, it's really quite frustrating when something small doesn't
work in one of these plugin DLLs, and know that if you could only debug
it, you could fix the problem in no time
 
M

Mike

Hi Jon

Jon said:
Do you know anyone that would know? Someone I could perhaps email to
find out, it's really quite frustrating when something small doesn't
work in one of these plugin DLLs, and know that if you could only debug
it, you could fix the problem in no time

<MSDN docs quote>

The Visual Studio debugger uses the project.PDB file created by the
linker directly and embeds the absolute path to the PDB in the EXE or
DLL file. If the debugger cannot find the PDB file at that location or
if the path is invalid (for example, if the project was moved to another
computer), the debugger searches the path containing the EXE, the Symbol
Path specified in the solution's Property Pages (Common Properties
folder, Debug Symbol Files page). The debugger will not load a PDB that
does not match the binary being debugged.

</MSDN docs quote>

Have you tried copying your DLL's PDB to the device? (Perhaps try
putting it in both the DLL's and the launching EXE's directory.)

Are you sure the PDB matches the version of the DLL you're loading?

Regards

Mike
 
J

Jon Brunson

Mike said:
<MSDN docs quote>

The Visual Studio debugger uses the project.PDB file created by the
linker directly and embeds the absolute path to the PDB in the EXE or
DLL file. If the debugger cannot find the PDB file at that location or
if the path is invalid (for example, if the project was moved to another
computer), the debugger searches the path containing the EXE, the Symbol
Path specified in the solution's Property Pages (Common Properties
folder, Debug Symbol Files page). The debugger will not load a PDB that
does not match the binary being debugged.

</MSDN docs quote>

Have you tried copying your DLL's PDB to the device? (Perhaps try
putting it in both the DLL's and the launching EXE's directory.)

Are you sure the PDB matches the version of the DLL you're loading?

Regards

Mike

Thanks for the info Mike.

I'm positive I'm using the right version of the pdb file, as I copy it
from the build folder (<BuildFolder>\Plugins\) to the following
locations before attempting to load the DLL:

Smart Device:
<MyAppsFolder>\ (where the exe that loads the DLL lives)
<MyAppsFolder>\Plugins\ (where the DLL Lives)

Desktop:
<BuildFolder>\ (where the exe is compiled to)

Yet I still cannot debug the DLL, and it says:

'<MyApp>.exe': Loaded '<BuildFolder>\<MyDLL>.dll', No symbols loaded.

In the output window when it does the Assembly.LoadFrom(). Which I find
strange, as the path is <BuildFolder>\Plugins\<MyDLL>.dll and
<MyDLL>.dll doesn't even exist in <BuildFolder>\. For one, it's on the
Smart Device, no the Desktop PC.


Any more thoughts?
 
S

Steve Maillet \(eMVP\)

Copying the PDB to the device will do no good. VS.NET needs it on the
desktop. in the same place as the EXE it referenced to launch the debugger
in the first place or in the path specified in the project's settings as
described in the MSDN docs quoted. This has been the way the dev tools have
worked since day one for remote debugging.

--
Steve Maillet
EmbeddedFusion
www.EmbeddedFusion.com

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups
 
M

Mike

Hi Jon,
Any more thoughts?

I hear your problem. Somebody with more knowledge of the Visual Studio
debugger than me may be able to help you place your PDB files so that it
can find them.

Failing that, I could recommend you try WinDbg. I've often used it
(successfully) for remote debugging, but unfortunately never with Smart
Devices.

If you're able to establish a debugging session with a process on your
device, it allows you to manually load PDB symbols into the debugging
session (from the File menu, IIRC). This could solve your problem.

Another thought, have you tried running your application in the
emulator? It may be a little easier to coerce the debugger into reading
the PDB file if it's all happening locally.

Regards

Mike
 

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