CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    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.
    Last edited by GCDEF; March 28th, 2012 at 02:06 PM.

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    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.

  3. #3
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Debugger not aware of code changes any more

    Quote Originally Posted by Lindley View Post
    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.

  4. #4
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656

    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?
    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinWindows - replacement windows manager for Visual Studio, and more...

  5. #5
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Debugger not aware of code changes any more

    Quote Originally Posted by VladimirF View Post
    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.

  6. #6
    Join Date
    Nov 2002
    Location
    California
    Posts
    4,556

    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

  7. #7
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Debugger not aware of code changes any more

    Quote Originally Posted by MikeAThon View Post
    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.

  8. #8
    Join Date
    Jan 2002
    Location
    Houston, TX
    Posts
    1,421

    Re: Debugger not aware of code changes any more

    Quote Originally Posted by GCDEF View Post
    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.
    Be sure to rate those who help!
    -------------------------------------------------------------
    Karl - WK5M
    PP-ASEL-IA (N43CS)
    PGP Key: 0xDB02E193
    PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

  9. #9
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Debugger not aware of code changes any more

    Quote Originally Posted by krmed View Post
    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.

  10. #10
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured