Thread: MSVS 2003, 2005 debugger issues

  1. #1
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607

    MSVS 2003, 2005 debugger issues

    Why is that the MSVS debugger cannot look at the contents of dynamic arrays and cannot look into template classes in the watch window?

    For instance using Boost or any STL container pretty much assures you that the debugger cannot look at the contents of the object.

    It also appears that it cannot look at the contents of any dynamic memory.

    Is there some setting I'm missing or is this standard behavior?

  2. #2
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    That is normal. since it cannot know at runtime how many elements the dynamic array holds.

    ok, its a double*, but does it point to a value, or an array of values. its a double**, does it point to an array of pointer to values, or an array of array of values, or some comblination of the two? (yes ive seen this in actual code). Then when you get into the whole stl stuff, the data is not guaranteed to be in contiguous memory.

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Actually, my VS 2005 pretty-prints all STL containers like it's supposed to. Works perfectly.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    I'll re-check my 2005 to see if I'm incorrect here. I know 2003 professional does not pretty print STL containers.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    That might be because "pretty-print" wasn't implemented until 2005.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    You have the ability to alter what gets shown in the debug window for different classes. It's somewhat complicated and might not be as easy in 2003 as you'd like, but it's worth a shot.

  7. #7
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Bubba View Post
    Why is that the MSVS debugger cannot look at the contents of dynamic arrays and cannot look into template classes in the watch window?
    Sure it can...

    In quickwatch, type "ptr,n" where ptr is the pointer, n is the number of elements you want to see
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  8. #8
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Daved View Post
    You have the ability to alter what gets shown in the debug window for different classes. It's somewhat complicated and might not be as easy in 2003 as you'd like, but it's worth a shot.
    I never got such manipulation to work properly...
    My main complaint is that the VS debugger pretty prints a lot of types, but sometimes I just want to see plainly how they look, as I want it! But Microsoft has chosen often not to include an option to do that.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #9
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Google "autoexp.dat". It's been around since 6.0. Rename it and everything should show "as-is".

    gg

  10. #10
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Pretty print is good, but just sometimes unwanted.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  11. #11
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Google "autoexp.dat". It's been around since 6.0. Rename it and everything should show "as-is".
    Is this something that would be wise to put on a dev box at work? I'm a little hesistant at messing with my IDE at work and less so with my one at home.

  12. #12
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Quote Originally Posted by Elysia View Post
    My main complaint is that the VS debugger pretty prints a lot of types, but sometimes I just want to see plainly how they look, as I want it! But Microsoft has chosen often not to include an option to do that.
    Yes, they did.
    http://msdn.microsoft.com/en-us/libr...kt(VS.80).aspx
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  13. #13
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    That's just an option on how to display a member. But if you want to scourge through the internals in a vector?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  14. #14
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> Is this something that would be wise to put on a dev box at work? I'm a little hesistant at messing with my IDE at work and less so with my one at home.

    I did with my work IDE (thanks Codeplug for remembering the name). It didn't cause me any problems.

    I would actually recommend using it for your dev box at work, although I'd try it at home to get a feel for it first since it is not terribly straightforward and you don't want to waste too much time in the office trying to get it to work right.

  15. #15
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Quote Originally Posted by Elysia View Post
    That's just an option on how to display a member. But if you want to scourge through the internals in a vector?
    What do you mean? If you have a vector v, then "v !" will give you the standard object view of the vector, which means that you can look at its members.
    If you want to get more low-level than this, take the address of the vector and paste it into the memory viewer.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Annoying compilers
    By anon in forum A Brief History of Cprogramming.com
    Replies: 42
    Last Post: 12-14-2008, 04:30 AM
  2. stdin in Visual Studio 2005 vs. 2003
    By Trev614 in forum C Programming
    Replies: 5
    Last Post: 06-23-2008, 02:44 PM
  3. Just-In-Time Debugger (Visual Studio 2005)
    By Darklighter in forum Tech Board
    Replies: 2
    Last Post: 10-10-2006, 01:43 PM
  4. New patch for MSVS 2005 standard
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 07-14-2006, 11:58 AM
  5. FILES in WinAPI
    By Garfield in forum Windows Programming
    Replies: 46
    Last Post: 10-02-2003, 06:51 PM