Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Value for a structure is not showing in watch window in VS2008

Value for a structure is not showing in watch window in VS2008

Scheduled Pinned Locked Moved C / C++ / MFC
debugging
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    manoharbalu
    wrote on last edited by
    #1

    We have a console application in VS2008 in which we have defined a global variable for a structure. The members of the variable are used throughout the application in various functions. Recently we have taken some of the functions out of the application to create a separate library and have included the library and the header file in the console application. Now When I build the application and run it, the output and behavior of the whole application is correct and same as before. But when i try to set breakpoints and debug some of the functions in the console application to watch the values in the watch window, the structure variable shows empty in the value column. The global variable for the structure is also used in the library. Please suggest a solution to view the values in the watch window

    L 1 Reply Last reply
    0
    • M manoharbalu

      We have a console application in VS2008 in which we have defined a global variable for a structure. The members of the variable are used throughout the application in various functions. Recently we have taken some of the functions out of the application to create a separate library and have included the library and the header file in the console application. Now When I build the application and run it, the output and behavior of the whole application is correct and same as before. But when i try to set breakpoints and debug some of the functions in the console application to watch the values in the watch window, the structure variable shows empty in the value column. The global variable for the structure is also used in the library. Please suggest a solution to view the values in the watch window

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Check the project settings and ensure that both the application and library are built in Debug mode.

      M 1 Reply Last reply
      0
      • L Lost User

        Check the project settings and ensure that both the application and library are built in Debug mode.

        M Offline
        M Offline
        manoharbalu
        wrote on last edited by
        #3

        Problem solved. One of the lib was in release mode. got it fixed. Thanks

        L 1 Reply Last reply
        0
        • M manoharbalu

          Problem solved. One of the lib was in release mode. got it fixed. Thanks

          L Offline
          L Offline
          leon de boer
          wrote on last edited by
          #4

          That should work and does on VS2015 and VS2107 so if it doesn't work on VS2008 it's a very old bug. You can however easily hack around it, just make a local variable struct and copy the global struct to the local ... the watch window can't get that wrong and it's one single line of code :-) Other alternative is to try the later compilers, they are free and easy to download and try.

          In vino veritas

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups