bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: To see a memory location using gdb


From: Andrew Cagney
Subject: Re: To see a memory location using gdb
Date: Thu, 29 Nov 2001 11:51:07 -0500
User-agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.3) Gecko/20011020

If the memory you are pointing to, points to a char then do "p (char *)ptr"
else cast the pointer to the specific type it points to. (void *) is just a
pointer to something, so gdb does not know how to interpret the value the
pointer points to.


The other option is the ``x'' command.

        x/4b   0xc0c8ab0

will print that as 4 bytes

-----Original Message-----
From: address@hidden [mailto:address@hidden
Sent: Thursday, November 29, 2001 8:48 AM
To: address@hidden
Subject: To see a memory location using gdb


Hi every body,
 I was looking for a GDB news group and i can found only this one.
There is one void * ptr. And if i want to see the memory content what
can i do? If i try print ptr, then i can see the memory address
(suppose it is 0xc0c8ab0). Please help.

Mem






reply via email to

[Prev in Thread] Current Thread [Next in Thread]