Author Topic: How to see the Memory's data?  (Read 3745 times)

Offline gonboy

  • Multiple posting newcomer
  • *
  • Posts: 29
How to see the Memory's data?
« on: August 11, 2008, 04:29:31 am »
When I debug the program in Ubuntu8.04 and codeblocks8.02?

I couldn't watch the memory's data?

eg:
     the code is :
int main(int argc,char *argv[])
{
    char *p;
    char *q;
    p = (char *)malloc(16*sizeof(char));
    q = p;
    if(p == NULL)
    {
        printf("calloc P is fail \n");
    }
    else
    {
        printf("calloc P is ok \n");
        p = "12345";
        free(q);
    }
    return 0;
}


question:
            I want to see the data in the address of p point?
            so I open the Memory dump, input the address of P(from the watch dialog). But i see nothing.
How should to debug ? and see the data in the memory?

Thank you  for your help!



Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: How to see the Memory's data?
« Reply #1 on: August 11, 2008, 07:37:43 am »
This is a bug, that was fixed in svn r5076/r5077.

If you really need that you should switch to an actual nightly.

Have a look in this board, to pick-up an actual build.
There are also repos with .debs provided by me (for debian) and Xaviou and pasgui for ubuntu. Please have a look in the threads.