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: Kevin Buettner
Subject: Re: To see a memory location using gdb
Date: Thu, 29 Nov 2001 12:47:38 -0700

On Nov 28, 10:47pm, Memana wrote:

> 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.

Either cast it to a different type so that ``print'' works or use the
``x'' (examine memory) command.  E.g,

    (gdb) print * (long *) ptr

or

    (gdb) x/16x ptr

(There are other options for the examine memory command.  Consult the
GDB documentation for more information.)

Kevin



reply via email to

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