question

flaviu avatar image
0 Votes"
flaviu asked ·

the breakpoint will not currently be hit

I am trying to debug a MFC app, and when I put a breakpoint inside of my code, I got:

 the breakpoint will not currently be hit no symbols have been loaded for this document

Of course, I am aware to have pdb file just near by my exe, and I have checked/unchecked "Enable Just My Code", and other options, none of them had worked. Why ? What else should I check in order to have my breakpoints as functional ?

c++
· 2
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You don't need to have the EXE/PDB "near by" each other.

Ensure the EXE/DLL you're debugging is the one that you've built and that its built as a debug one with debugging information. If it doesn't match, or doesn't have debug information, then that's what happens.

Check the VS modules window pane when you're debugging too.

0 Votes 0 ·
flaviu avatar image flaviu DavidLowndes-6766 ·

I have compiled right now the test project:

73784-image.png

They are in the same folder, and they are new, and there is no other pdb files inside of my test project.


0 Votes 0 ·
image.png (25.5 KiB)
BarrnetZhou-MSFT avatar image
0 Votes"
BarrnetZhou-MSFT answered ·

First, I suggest that you could clean the project and rebuild the project. Delete all pdb files in the program directory.

If it doesn't work, you could select Debug -> Windows -> Modules. You'll see a list of all the assemblies that are loaded into the process. Locate the one you want to get debug info for. Right-click it and select Symbol Load Information. You'll get a dialog that lists all the directories where it looked for the .pdb file for the assembly. Verify that list against the actual .pdb location. Make sure it doesn't find an old one. In normal projects, the assembly and its .pdb file should always have been copied by the IDE into the same folder as your .exe, i.e. the bin\Debug folder of your project.

Besides, Make sure you are debugging in Debug mode and the project settings are x86 or x64.

· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I have deleted all generated files, because is a simple test project. Still the same behavior ...

0 Votes 0 ·
flaviu avatar image
0 Votes"
flaviu answered ·

I have tried:

73786-image.png



Why ?


image.png (95.1 KiB)
· 3 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Could you provide a minimal example or code snippet? This will help reproduce and solve the problem.

0 Votes 0 ·
flaviu avatar image flaviu BarrnetZhou-MSFT ·

There is no point to attach a sample project, because this issue is acting on any test project, it's not a project issue, is a VS2017 issue ... I guess is a VS2017 settings, but I don't know which one.

I have tested a sample project on another PC, with a fresh installed VS2017, and this issue is not present.

0 Votes 0 ·

So it must be a setting in your project. I'm sorry I don't know which switch in your VS 2017 project must be set. But you say you have a running project on another PC. You can copy your project to the other PC to check if it complains the same way.
But the easiest way to find the difference is to compare both project settings.
If you don't find anything, then maybe you should reinstall VS 2017.
Regards, Guido

0 Votes 0 ·