locked
Debug not working any more (PDB can't be loaded) RRS feed

  • Question

  • My problem appear this Monday, I cant run any program in Visual C++ in debug mode, it runs, but wont stop in any breakpoint, if I press F11 then the a window telling me that :"ConsoleApplication2.pdb not loaded", where my application is named ConsoleApplication2.pdb.

    It happens that the generated pdb file cant be loaded, if I manually select the PDB file using the browse button it says "A matching symbol file was not found in this folder".

    The breakpoint shows as a white point (like when they are disabled), before that all was working fine.

    I'm an experienced programmer, I have been using VC++ since more than 20 years.

    This problem only happen in an specific computer, if I copy to other, the debugger works as expected.

    I created  a new program, simple, the basic console application (see below) and the problem is there, any C++

    The sample I'm running is the basic console application code.

    This only affects the CLI projects in C++, programs in C# or win 32 (C++ win 32 console) work fine.

    All existing and new CLI C++ projects have the same problem, the DPB does not loads, the program runs fine, but I cant debug them (the break points does not works, I can not even use the F11 and then reach my point).

    The problem started with Visual Studio Express 2013, update 5, I installed the 2015, same results in both of them, totally uninstall the 2013 and the 2015 (using the /Force option), delete all folder traces and registry keys for both version, re installed the 2015, the problem remains.

    I'm signed in in VS.

    I'm running windows 7 Enterprise service pack 1, 64 bits.

    I open the PDB file with a text editor it I can open and it has data, so it is not blocked by an antivirus and was actually generated. I have run the rebuild, rebuild all, deleted all files manually and regenerated.

    The options for the projects has the "No Whole Program Optimization", the general options, has the "Enable just my code" disabled (I checked with it enabled and disabled), The same with the "Use Managed Compatibility Mode", no success.

    I think 

    The simplest code I'm running is the standard code generated by the wizard

    // ConsoleApplication2.cpp : main project file.
    #include "stdafx.h"
    using namespace System;
    int main(array<System::String ^> ^args)
    {
        Console::WriteLine(L"Hello World");
        return 0;
    }

    Any help is appreciated, the last option I have is reformat the computer, but is not the best option I have.

    Thursday, October 1, 2015 3:07 PM

Answers

  • If this issue only appears in CLI project, Please check one thing if it helps:

    Project properties-> Debugging->Debugger Type ->Mixed


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Shu 2017 Thursday, October 15, 2015 9:10 AM
    • Marked as answer by Shu 2017 Friday, October 16, 2015 9:40 AM
    Friday, October 2, 2015 7:03 AM

All replies

  • Rebuild your solution make sure you are building in debug mode and check for pdb file path as well.

    Thnaks


    Rupesh Shukla

    Thursday, October 1, 2015 4:31 PM
  • Thanks....

    Yes, I have done that also, several times, after restarting computer, installing latest services updates, related to this, I did:

    *) I did a rebuild All.

    *) Manually deleted ALL intermediate and files.

    *) Deleted the the intermediate, temporal, the sdf and even the suo files and recompiled

    Also I have check the path, I manually browsed to the location where the PDB file is, and opened it using the load symbols dialog ( and VS said: "A matching symbol file was not found in this folder").

    Any of the above trials worked.

    Thursday, October 1, 2015 5:01 PM
  • My problem appear this Monday, I cant run any program in Visual C++ in debug mode, it runs, but wont stop in any breakpoint, if I press F11 then the a window telling me that :"ConsoleApplication2.pdb not loaded", where my application is named ConsoleApplication2.pdb.


    Is this an error or did you really give a .pdb extension to the executable to be created by the VS build?
    Thursday, October 1, 2015 5:20 PM
  • When you are in the vs, if press f11, you will start the debug "in to" the code, so, the first thing it does is asking for the not loaded PDB files for the windows assemblies, there is an option to manually specify the pdb files to load, in addition to the ones that are in the repository or in the cache, there I specified the pdb for my project.

    As I mention, I have 20 years using compilers and many sw tools, I know how to debug, how to create the symbols repository, how they work, how to rebuild , etc. this is an error that suddenly appeared and I have done all I know that may work.... renaming the exe to pdb will not work at any way, much less to start the debugging, the PDB and the EXE are totally different things.

    And no, I'm not really sure it is a bug (at least not usual bug) because it has been working for years, more probably something changed, an update from windows or some similar, because the 2013 and 2015 have the same behavior, unless they are using the same BIN repository and registry keys, I have no idea why they both fail the same way, even after total reinstal.

    I have no idea what else to try

    Thursday, October 1, 2015 5:32 PM
  • F11 is Step into and F5 is for debugging , looks like you are trying to step in some file for which you don't have code in that case def you will get this message .

    Thanks


    Rupesh Shukla

    Thursday, October 1, 2015 9:47 PM
  • As I said before, I have 20 years using this complier, I have created projects for standalone applications, dlls, COM libraries, remote an local, I been creating .net applications since several years, even used managed and no managed code, wcf, and a lot of programming techniques, I have a lot of experience on how to debug, I know what I can and what I can't debug, in my starting post I said that any project can run in debug, i mean, no breakpoints working, even projects new and simple as the basic cli console project, that if you create and put a breakpoint and runs, will break, in my computer it does not breaks, just runs, as if the program was compiled with all debug settings off, but the pdb is there, same path than the exe file.... is there something else than me just ignoring how to debug a program, some setting or any thing that does not allows the debugger to load the pdb file even if I directly instruct it to load and specify the file, yes... the build dates and time matches, they are created together... it just ... does not loads.. even a release build can execute a breakpoint, but now, with this issue, any breakpoint is working, the code just runs.... the attach debugger options does not works either.. 
    Friday, October 2, 2015 12:49 AM
  • Have you tried inserting _CrtDbgBreak()  in the code?
    Friday, October 2, 2015 2:24 AM
  • If this issue only appears in CLI project, Please check one thing if it helps:

    Project properties-> Debugging->Debugger Type ->Mixed


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Shu 2017 Thursday, October 15, 2015 9:10 AM
    • Marked as answer by Shu 2017 Friday, October 16, 2015 9:40 AM
    Friday, October 2, 2015 7:03 AM
  • If this issue only appears in CLI project, Please check one thing if it helps:

    Project properties-> Debugging->Debugger Type ->Mixed


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Great suggestion!
    Friday, October 2, 2015 10:30 AM
  • I had Created a Win32 Console App on visual Studio 2013 Professional with the code mentioned by you.

    #include "stdafx.h"
    using namespace System;
    
    int main(array<System::String ^> ^args)
    {
    	Console::WriteLine(L"Hello World");
    	return 0;
    }

    And then had added the support for  clr in my app from 

    Configuration Properties ==> General ==> Common Language Runtime Support ==>/clr

    C/C++ ==> General ==> Common Language Runtime Support ==>/clr

    My debugger type is Set to Auto here .Which is default . And now after compilation i am able to debug the code without any issue . Can you try creating a small App again and try it out at your side.

    Thanks


    Rupesh Shukla


    Friday, October 2, 2015 2:23 PM
  • Hi FeArias.

    Do you have any update on this issue?

    Best regards,

    Shu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 12, 2015 12:20 PM