CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Threaded View

  1. #6
    Join Date
    Jun 2008
    Location
    greater Cincinnati
    Posts
    54

    Re: What are some ways to trace a pointer ?

    After using the VS 2008 " Data Break Point" I've come to understand that their only functionality is to break execution when the value at such and such memory address is wrote to. One problem with this is that the memory may be freed without warning and then bound to a completely unrelated variable or pointer.

    Also, I am trying to trace each location in code in which the address is read from, wrote to, assigned to reference &(C++ only), assigned to pointer. It would also be nice if there was a way to also trace any variable that recieves the value at that address.


    And while we're at it, it would also be nice if there was a graph to visually display these connections/relationships (e.g. the Callers and Caller graph in VS 2008, Dot graphs in Doxygen, etc.) Of course, a graph is nice, but not completely necessary.

    ----------------------------------------------
    Here is what I am trying to do right now.

    In this file:
    https://svn.blender.org/svnroot/bf-b...erface_panel.c

    At this function:
    static void ui_handle_panel_header( )

    The member " block->panel->flag " is either enabled or disabled in order to expand or collapse panels within the " Blender 3D " user interface.

    code snippet:
    Code:
      
     if (block->panel->flag & PNL_CLOSED) {
         block->panel->flag &= ~PNL_CLOSED;
         /* snap back up so full panel aligns with screen edge */
         if (block->panel->snap & PNL_SNAP_BOTTOM) 
             block->panel->ofsy= 0;
     }
     else if (align==BUT_HORIZONTAL) {
         block->panel->flag |= PNL_CLOSEDX;
     }
     else {
         /* snap down to bottom screen edge*/
         block->panel->flag |= PNL_CLOSEDY;
    I am trying to find out where in Blender's codebase is the " block->panel->flag " value being used to test whether to draw a panel expanded or draw a panel collapsed. I think if there is a resolution to the questions below then that should help resolve the above scenario.


    ---------------------------------------------

    Lastly, I am still interested in an answer to my questions in my first post above. So here are those questions again, but with a few changes.

    ==================QUESTIONS======================

    1) Can Visual Studio 2008 or any software at all trace the usage (ANY usage at all) or appearance of a memory addess/pointer/variable within a codebase ?
    (e.g. VS 2008, and Doxygen, etc., can trace the hierarchy of classes and functions)

    2) What are some ways to trace a pointer?

    3) How would - you - personally trace the usage of a variable or pointer within a codebase ?
    (e.g. the data member " block->panel->flag " in the code snippet above)

    ================================================

    If anyone else should happen to have an answer and help me - thanks. Good day.
    Last edited by kmkkra; April 3rd, 2012 at 08:10 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured