Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"The breakpoint will not currently be hit" - and I cannot add the .pdb file

I have a solution with one project in Visual Studio 2013 (Visual C++).

But when I build it in debug mode, then run it in debug mode I get:

The breakpoint will not currently be hit. No symbols have been loaded for this document.

I was trying to fix it in analogical way to what people suggested for Visual C# Fixing "The breakpoint will not currently be hit. No symbols have been loaded for this document."

Unfortunately, none of that worked:

  • clean & rebuild solution (also with manually deleted temporary files),
  • solution -> Properties -> Startup Project -> startup projects -> Start action,
  • Debug/General settings -> uncheck Just My Code,
  • quit VC++, reload, restart PC.

Then I've tried to select the .pdb file (after clear, rebuild) with Debug -> Windows -> Modules and RMB -> Load symbols. v120.pdb was in /Solution/Debug folder and .exe was in /Bin folder. I've chosen it and I got an error message:

A matching symbol file was not found in this folder.

What else can I do? Which solution/project options may have affected debugging? I build an x86 .exe project that include some of my .lib files (but the debugging doesn't work even in main.cpp).


Additional information (some were requested by users in comments):

I see that under Debug -> Windows -> Modules there is such entry for my .exe:

Project.exe F:...exe N/A N/A Binary was not built with debug information. 1 12/15/2014 12:31 PM 00BA0000-00E9C000 [3504] Project.exe

That's quite strange because the Solution/Debug folder is being created each time I hit Rebuild for Debug mode, and so I get new .pdb file also. I am running the application with Debug mode selected.


The value of Project -> Properties -> C/C++ -> General -> Debug Information Format is Program Database for Edit And Continue (/ZI).

like image 260
PolGraphic Avatar asked Dec 15 '14 11:12

PolGraphic


People also ask

How do I run a .pdb file?

The easiest way to use the PDB file is to let Visual Studio do the heavy lifting - either launch your program with Visual Studio's "Debug" command (F5 by default), or run the program and use the "Attach to Process" item in Visual Studio's Debug menu.

How do you add a breakpoint in Visual Studio 2022?

Set breakpoints in source code To set a breakpoint in source code, click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint.

Where do I put PDB files?

pdb file stores all debug information for the project's .exe file, and resides in the \debug subdirectory. The <project>. pdb file contains full debug information, including function prototypes, not just the type information found in VC<x>. pdb.

How to fix resolving breakpoint is not working?

Resolving breakpoint will not be hit error ways. We will start with simple solution, try to clean your solution and then re-build. For this, simply open your "Solution Explorer", select your "Solution" and right click on it, Select "Clean Solution", once solution is cleaned, which will delete all the compiled and temporary files associated ...

What is Breakpoint will not currently be hit in Visual Studio?

If you are C# developer or ASP.NET web -developer, who is using Visual Studio as his/her IDE, at one stage you will hit with an error called "The breakpoint will not currently be hit.The source code is different from original version.", so in this post, I have explained how we can resolve this using few simple steps.

How do I debug a PDB file?

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.

Why can’t I pick up the PDB file?

This problem usually occurs because the web application is not able to pick up the .PDB from the Temporary ASP.NET Folder. We will start with simple solution, try to clean your solution and then re-build.


1 Answers

It looks like you're not properly generating debug information which is what the modules window is telling you. Make sure that the following properties are both set up:

Project -> Properties -> C/C++ -> General -> Debug Information Format

and

Project -> Properties -> Linker -> Debugging -> Generate Debug Information.

These can sometimes get change accidentally.

I've never seen this information get lost without a good cause though unless you've got a custom build solution

like image 74
Mike Vine Avatar answered Oct 23 '22 02:10

Mike Vine