Re: unable to set breakpoint



Sorry, I am a bit confused by your following statement:
"By updating the C/C++ option, I'm not able to set a breakpoint and do
source-level debugging on the library regardless of where its located on
my
machine."

I am not sure if the word "not" is a typo or not since you said you had
found the problem.

sorry, talk about an inconvenient typo :) It was supposed to say, "I'm now
able to set a breakpoint ...", i.e. its working now and I don't need to have
the binaries in their original built locations.

Regarding your original workaround, I suspect this is an internal
algorithm
of VS debugger. Actually, the simplest way to tell the VS debugger where
to
probe the source code files is setting the "Source Paths":
Right click Solution / Properties / Source Paths

This should be a simple solution without maintaining a source server.

Yes, the source paths do seem to work well when needed. Once I understood
what was going on, I renamed the source dir to "hide" it and sure enough,
when trying to step in the code VS prompted me for the source file. I added
the altered directory to the source path and it then found it on its own.

Granted, with this approach its purely filename matching which is where the
source server you mentioned earlier would come in. I haven't yet
investigated as to whether or not it would work with our revision control
system (the info I've read about it refers to VSS and I think CVS).

Regarding the debug information generation in compiler and linker, the
great article below should be informative:
"generating debug information with visual c++"
http://www.debuginfo.com/articles/gendebuginfo.html

The PDB file format is undocumented, so I do not know of a tool to examine
it yet.(If anyone can share one, I'd like to hear) I think we have to use
dbghelp.dll API to check the source file information in it. Another simple
way is using the "!lmi" command in windbg, see the "Load Report: private
symbols & lines, source indexed" line below:

0:000> !lmi ntdll
Loaded Module Info: [ntdll]
Module: ntdll
Base Address: 7c800000
Image Name: ntdll.dll
Machine Type: 332 (I386)
Time Stamp: 45d70ad8 Sat Feb 17 22:02:00 2007
Size: c0000
CheckSum: bd6f9
Characteristics: 210e perf
Debug Data Dirs: Type Size VA Pointer
CODEVIEW 22, 86a6c, 85e6c RSDS - GUID:
{93E72E10-9DC8-4F16-AA54-797E4DA8C168}
Age: 2, Pdb: ntdll.pdb
CLSID 4, 86a68, 85e68 [Data not mapped]
Image Type: FILE - Image read successfully from debugger.
C:\WINDOWS\system32\ntdll.dll
Symbol Type: PDB - Symbols loaded successfully from symbol server.

c:\LocalSymbols\ntdll.pdb\93E72E109DC84F16AA54797E4DA8C1682\ntdll.pdb
Compiler: C++ - front end [13.10 bld 4035] - back end [13.10 bld
4035]
Load Report: private symbols & lines, source indexed

c:\LocalSymbols\ntdll.pdb\93E72E109DC84F16AA54797E4DA8C1682\ntdll.pdb

Hope it helps.

Yes, thanks for your help. Note that what I did was use the "strings"
command. This is a unix command which pulls out all the printable strings
from a file. You can use this (as well as many other unix shell commands)
on Windows with the help of cygwin (www.cygwin.com). So in my case, I was
able to do the below in a cygwin shell to list all source files contained in
the .PDB.

strings myfile.pdb | grep '.cpp'



.



Relevant Pages

  • RE: pdb files for assemblies in GAC?
    ... the .pdb file to the same file folder in the gac. ... debugger, I saw that it loaded the symbols from the gac location. ... put the symbol files there. ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework)
  • RE: pdb files for assemblies in GAC?
    ... The debugger needs a way to find the pdb ... If all the pdb files are placed in the installation ... assume the pdb files are in the same folder as the assembly. ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework)
  • Re: pdb bug and questions
    ... Subject: pdb bug and questions ... I'm trying to embed a debugger into an editor. ... (pdb, pydb, rpdb2, smart debugger, extended debugger? ... This looks like a bug to me. ...
    (comp.lang.python)
  • Re: Debuggers
    ... This can be seen with pdb, but not pydb. ... I agreed the idea to restart the debugger when an exception is trow. ...
    (comp.lang.python)
  • Re: Debugging question
    ... The Visual Studio debugger uses the project.PDB file created by the ... If the debugger cannot find the PDB file at that location or ... Path specified in the solution's Property Pages (Common Properties ... Are you sure the PDB matches the version of the DLL you're loading? ...
    (microsoft.public.dotnet.framework.compactframework)