Breakpoint Will Not Be Hit, No Symbols Loaded - But They Are Loaded

I’m stumped as to what’s going on but I can no longer debug my CreatureHonor script that I’ve been working on. I applied it to a fresh core and suddenly none of my breakpoints work in Visual Studio.

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

After compiling in Debug configuration and then clicking Debug->Start Debugging I get the above warning on my breakpoints. The Modules window in the IDE shows that worldserver.exe loaded the PDB from BinDebug so I don’t understand why my script is not included in the PDB.

I tried cleaning and rebuilding, I tried cloning the repo and applying my patch again but I still can’t get the script to be included in the PDB file.

Any ideas or suggestions?

Note: Debugging works fine on an old repo but I can’t use that because certain features don’t exist compared to new repos (eg: the ObjectGuid class).

This has been happening for me a lot with VS2009. Try deleting .ncb file in your build folder (Intellisense Database file, it will be recreated). Just make sure you close VS first.

Thanks but VS 2013 doesn’t use NCB files, I think it uses SDF for intellisense. I wonder why Intellisense would have any effect on breakpoints though.

One thing I’m curious about is if it’s related to how I’ve added the new file to the project. I modified CMakeLists.txt so that the file is included rather than adding it directly through the IDE and it’s the only file in the entire solution that I can’t set breakpoints on. I wonder if there’s some property that isn’t set… who knows.

Well, I still cant figure out why VS suddenly decided it doesn’t like my script but I was able to manage a workaround.

I copied the function I wanted to debug into ScriptMgr.cpp and then called it directly, prior to the line that would’ve called it in the script. It works so I was able to push my commit after removing my test function from ScriptMgr.cpp.

Did you try deleting and rebuilding the whole build dir? (the one with the VS .sln and project files)

Yes, I even pulled a fresh clone, exported my commit as a patch from the old repo and applied it to the new one. Same problem. Could it be a problem with PCH? Do I need to do something special with CMake to get my script added to the script PCH?

The strange thing is I had this problem in VS 2008 when I was working on the PetAI but it resolved itself mysteriously. I wonder if it’s a bug with VS because sometimes I will see all kinds of error indicators in the margin saying things like Unit is not a valid class or structure when I’m in the actual Unit.cpp file. I have to close and reopen the solution to clear it.