Tell me how to debug dll (with the ability to set breakpoints, view the values ​​of variables, etc.)

This is my dll. I have 2 projects, and two studios are open in one dll in the second program that uses it. I put a stopping point in the dll but it does not work ... What does it mean collected with the program?

Like enter image description here I've done everything...

but does not work .. enter image description here

I added a project with dll to the main project on the screenshots can be seen. But the point does not work ...

  • In the pop-up on the second screenshot it is described in detail why exactly the breakpoint did not work and how to fix it. Have you tried to do what is written there? - PashaPash
  • Oftop. Is the "x86" configuration standard or did it yourself? - Cerbo

3 answers 3

In order to perform such debugging, the following conditions must be met:

  1. The studio must have access to debugging symbols ( .pdb files) of the modules being debugged. You have this condition, in the debugger output window you can see the lines with the text "symbols loaded".
  2. Debugging symbols must match the binaries and sources. Then the debugger using characters has the ability to position the source in the place where there is a breakpoint. If there is no match, positioning is not possible. Matching symbols to binaries is performed automatically, as the symbols are generated each time a binary is compiled. But with the source code it often happens that the source is changed, and the compilation was not performed, that is, the characters and the binary remain old.

Here is the second situation you have and there is what you and the studio tells you in the hint.

    Make a solution of two projects and add one of them (with dll) depending on the other (with exe).

    • I forgot to write that this all in one studio should be launched :) - Grundy
    • @Grundy, to open one solution in two studios is always not a good idea;) - Qwertiy
    • Well, actually the question is :) This is my dll I have 2 projects, and two studios are open in one dll in the second program that uses it. - Grundy
    • @Grundy, in question 2 of the solution, I suggested making one. Doesn't this mean that there will be only one running studio? - Qwertiy
    • Nope :-) absolutely should not be :) - Grundy

    Two running studios are independent of each other. Therefore, the stopping point set in one studio will not work if the program is running in another studio.

    Set a stopping point only in the studio in which you run the program.

    • What about attach to process? - Qwertiy
    • @Qwertiy, yes, there is such an option, but at the same time the studio that does the attach goes into the running state. So, this is similar to setting a point in the studio launching - Grundy