Breakpoints cannot be set and disabled

If I add a breakpoint in the VC ++ 6.0 project and then start debugging, it will display this error message:

One or more breakpoints cannot be set and disabled. Execution will be stopped at the beginning of the program.

and displays the disassembly window. What is this problem?

How to add a breakpoint and start debugging?

+1
source share
5 answers

This problem occurs mainly when you set breakpoints in the source files other than the ones you start debugging with.

Suppose you started debugging the MainModule.dsw workspace, and from this open visual studio editor you inserted breakpoints in other cpp files, and then at the very beginning of debugging you get this error.

Instead of the build code, your editor should show the winmain or dllmain method if you set the source code path to the vc folder of the Visual Studio installaiton installation. Then you can understand what the basic logic of the error message is.

+1
source

I also had such a problem, but the code worked fine, and I even compared all the files with another instance that worked. The problem was a dash with leading and trailing spaces in the path. As soon as I deleted the trailing space (for example, "-dir" became "-dir"), then it worked fine. Although you can generally avoid dashes, if possible. Hope this helps someone else.

+1
source

The first two things to check:

  • Have you compiled your C ++ code with the correct settings for debugging information?
  • Did you also tell the linker to generate debug information?

Both of them are usually disabled when you create the binary in the release configuration. IME, the most common reason for the above error is because someone forgot to tell the linker about sending debugging information ...

I also saw this problem when a binary file with corrupted debugging information was associated with an executable and displaying unacceptable debugging information.

0
source

Most likely you have "Win32 Release" as the active configuration. Install it in "Win32 Debug", after which you will receive the necessary information for debugging.

0
source

Source: https://habr.com/ru/post/1309102/


All Articles