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. ATL / WTL / STL
  4. How to watch the objects value in a STL container in VS2003? Such as Vector

How to watch the objects value in a STL container in VS2003? Such as Vector

Scheduled Pinned Locked Moved ATL / WTL / STL
c++visual-studiographicsdockerdebugging
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.
  • B Offline
    B Offline
    Best Kiluyar
    wrote on last edited by
    #1

    Hi, all I'm debugging a program which use lots of STL container such as vector, list, etc. in VS2003 and meeting a very boring problem: I can not see the objects values, such as, all int values in a int vector, in VS debug watch window! I can only see the size of a container. I had to print all values one bye one. This is so inconvenient to make my work process slower. Do you have any ideas? Thanks a lot!:) Remy Zhu

    S 1 Reply Last reply
    0
    • B Best Kiluyar

      Hi, all I'm debugging a program which use lots of STL container such as vector, list, etc. in VS2003 and meeting a very boring problem: I can not see the objects values, such as, all int values in a int vector, in VS debug watch window! I can only see the size of a container. I had to print all values one bye one. This is so inconvenient to make my work process slower. Do you have any ideas? Thanks a lot!:) Remy Zhu

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      If you look at std::vector, it has a member _Myfirst. This points at the data held by the vector. So, examining _vector_var_._Myfirst[0] is the same as evaluating _vector_var_[0]. This definitely works in the Command Window and there's no reason why it shouldn't work in a Watch window. Alternatively, upgrade to VS 2005, as that has debug data visualizers :-) (no, I haven't upgraded either!)

      L 1 Reply Last reply
      0
      • S Stuart Dootson

        If you look at std::vector, it has a member _Myfirst. This points at the data held by the vector. So, examining _vector_var_._Myfirst[0] is the same as evaluating _vector_var_[0]. This definitely works in the Command Window and there's no reason why it shouldn't work in a Watch window. Alternatively, upgrade to VS 2005, as that has debug data visualizers :-) (no, I haven't upgraded either!)

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

        VS2005 does a much better job with showing the contents of std::vector and std::[w]string. Apparently you can add your own custom visualizers, but I have yet to try this.

        S 1 Reply Last reply
        0
        • L Lost User

          VS2005 does a much better job with showing the contents of std::vector and std::[w]string. Apparently you can add your own custom visualizers, but I have yet to try this.

          S Offline
          S Offline
          Stuart Dootson
          wrote on last edited by
          #4

          So I understand... However, we're pretty much stuck with VS2003 (not that I mind too much - I did when we were stuck with VS6!), although I may well sneak a crafty VS2005 onto my PC here :-) We only do native code development here, as I work for a large company, which has a tightly controlled standard Windows build, which doesn't yet include any version of .NET framework. Fortunately, I'm quite happy doing C++.

          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