Debugger not aware of code changes any more
Using VC 2008. In some projects that share source code, the debugger isn't aware of new or changed variables in the code. I'll add new members or rename existing members in a class and the watch window says they're not defined and autos doesn't show them or shows the old name. I've cleaned the project and deleted all temp files I can think of. What am I missing?
It seems to work if I use the C7 compatible debug option, but not the databases.
Re: Debugger not aware of code changes any more
Do you have an older copy of the header somewhere else in the search path? One way to tell is to find an #include statement, right-click, and open the header that way.
Re: Debugger not aware of code changes any more
Quote:
Originally Posted by
Lindley
Do you have an older copy of the header somewhere else in the search path? One way to tell is to find an #include statement, right-click, and open the header that way.
No. It's doing it in multiple classes too. The fact that the C7 debug option works probably indicates that's not the problem. I'm stumped.
Re: Debugger not aware of code changes any more
1. Could you please explain “In some projects that share source code, …”? How the fact that the source *might* be used in another project can affect current project?
2. Do you use /ZI or /Zi?
Re: Debugger not aware of code changes any more
Quote:
Originally Posted by
VladimirF
1. Could you please explain “In some projects that share source code, …”? How the fact that the source *might* be used in another project can affect current project?
2. Do you use /ZI or /Zi?
It's just source code in a directory that's outside the current project directory. It's shared among multiple projects and projects that share it have the directory in their additional includes path. Files in that directory are added to the project. It's worked like that for years.
I was using /ZI then tried /Zi and both had the problem. /Z7 seems to behave properly.
Re: Debugger not aware of code changes any more
Perhaps you have an older copy of the file in a search directory that the compiler finds before it finds the "real" file.
Mike
Re: Debugger not aware of code changes any more
Quote:
Originally Posted by
MikeAThon
Perhaps you have an older copy of the file in a search directory that the compiler finds before it finds the "real" file.
Mike
Lindley suggested that. I did a search to be sure, but that doesn't seem to be the case. It's happened with several shared files in several shared projects now.
If that were the case I would think it wouldn't even compile. I'm declaring variables in the class definition and using them in the class body, so the compiler's aware of them, just not the debugger. As I said, it works with the debug build option /Z, so it seems like it's just building the database out of old source. No idea where it's finding it though or why.
Re: Debugger not aware of code changes any more
Quote:
Originally Posted by
GCDEF
I've cleaned the project and deleted all temp files I can think of. What am I missing?
Since you didn't specify what temp files you thought of, are there any you didn't think of?
Not sure about VS2008 but the temp files I always delete (some for specific VS versions) are .ncb, .aps, .clw, .sdf, .suo. Check to be sure you have deleted all of those and you might find the problem.
Good luck.
Re: Debugger not aware of code changes any more
Quote:
Originally Posted by
krmed
Since you didn't specify what temp files you thought of, are there any you didn't think of?
Not sure about VS2008 but the temp files I always delete (some for specific VS versions) are .ncb, .aps, .clw, .sdf, .suo. Check to be sure you have deleted all of those and you might find the problem.
Good luck.
All of those that I could find. I tell VS to clean the project, then delete anything other than the .vcproj and .sln and source code. At this point I don't even know where it's finding the old definitions. They're not on my computer anywhere that I can find.
Re: Debugger not aware of code changes any more
I just tried changing the #include to give it a specific path rather than a relative one and it fixed the problem. I can't for the life of me figure out where it's getting the old definition from though. Strange.