Thread: Debugger : watching data members or arrays

  1. #1
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472

    Debugger : watching data members or arrays

    I always find it hit and miss adding watches that work when they are in arrays and or array members of classes, sometimes the debugger obliges and gives me an expandable tree showing changes to all the data members but sometimes it says they are not in current context, also with arrays it is same, especially 2d arrays. I dont know what to tell it to watch for example when i want to see the changes to the integer 'areatype' below >

    Code:
    solpeg[dwn][acr].areatype
    if this is in a loop counting through all the down and across values and accessing each < object[n][n].datamember > as it goes how can i watch the data members that are being referenced on each loop? I have tried using 'watch as array' but it doesnt seem to make much difference in my attempts so far.

    I am using CODE::BLOCKS by the way
    Last edited by rogster001; 11-10-2009 at 05:27 AM. Reason: advise IDE

  2. #2
    Registered User
    Join Date
    Oct 2009
    Location
    While(1)
    Posts
    377
    If you are working on Visual Studio then it will be there, i don't know why it is not coming in studio try to install visual assistance then it will be more helpful though

  3. #3
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472
    i see now that i cannot see changes being made when the array is passed to a function, it is like dynamic changes cannot be seen, when i follow the flow back to where the object was declared the changes can be seen and i can expand said tree.
    Last edited by rogster001; 11-10-2009 at 07:03 AM. Reason: i wonder if i could have got the words 'see' and seen' in a few dozen more times there...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. data structure design for data aggregation
    By George2 in forum C# Programming
    Replies: 0
    Last Post: 05-20-2008, 06:43 AM
  2. Save data from two struct arrays in one .dat file
    By IndioDoido in forum C Programming
    Replies: 5
    Last Post: 03-27-2008, 03:50 PM
  3. Bitmasking Problem
    By mike_g in forum C++ Programming
    Replies: 13
    Last Post: 11-08-2007, 12:24 AM
  4. Accessing private data members
    By maloy in forum C++ Programming
    Replies: 11
    Last Post: 10-04-2002, 02:48 PM
  5. static and non-static data members
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 06-16-2002, 10:06 AM