Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
899 views
in Technique[技术] by (71.8m points)

c++ - Is it possible to debug into a DLL with only a PDB and no source code?

I'm trying to debug an exe that calls a dll, in Visual Studio. I made sure I had the corresponding pdb in the same path as the dll.

But I cannot get into the functions that the dll is offering. I get a message that says "xyz.c was not found"

Why am I getting this message?

Does this mean that I can't get into the source code just from a DLL + .PDB? What about a static library (.lib) built using the /Z7 option?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

No, you need to have source code to be able to see the source code.

pdb (or /Z7) contains debug information which is like mapping between executable code and your source code. With pdb VS debugger knows where in source files each instruction is located, but it still needs to have source files to show you the code.

Usually pdb file stores location of source files and VS debugger knows where to find them. If you move src files somewhere else then AFAIK VS will show a popup dialog to browse for .c/.cpp file that it cannot find.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...