News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

How to see the Memory's data?

Started by gonboy, August 11, 2008, 04:29:31 AM

Previous topic - Next topic

gonboy

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!



Jenna

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.