MSVS 2003, 2005 debugger issues

This is a discussion on MSVS 2003, 2005 debugger issues within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Why is that the MSVS debugger cannot look at the contents of dynamic arrays and cannot look into template classes ...

  1. #1
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598

    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,189
    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.
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    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
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    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
    Posts
    23,001
    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,344
    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
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,270
    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
    Posts
    23,001
    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,699
    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
    Posts
    23,001
    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
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    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,893
    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
    Posts
    23,001
    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,344
    >> 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,893
    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

Page 1 of 2 12 LastLast
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, 03:44 PM
  3. Just-In-Time Debugger (Visual Studio 2005)
    By Darklighter in forum Tech Board
    Replies: 2
    Last Post: 10-10-2006, 02: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, 12:58 PM
  5. FILES in WinAPI
    By Garfield in forum Windows Programming
    Replies: 46
    Last Post: 10-02-2003, 07:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21