Re: Runtime memory organization for a process

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

 



On 3/24/06, Shrikanth Ramanath <shriek.007@xxxxxxxxx> wrote:
> If I run a executable for a process ( say I have written a simple c
> program and then compiled it to create a a.out executable), so on the
> bash console I run ./a.out, now my query is can I use GDB and find out
> variable stored in stack , heap, say more refined I want to see the
> bss , global storage area for a process using gdb  ... how can I do
> that ??

To attach to an already running process, enter "attach <PID>" in gdb,
to specifiy a target to debug, enter "gdb a.out" on the console.

To view the current stack, enter "stacktrace" or "stacktrace n" to
return only n innermost stack frames.  You can examine a stack frame
by entering "frame n" where n is either a frame number or an address;
use frame up/down to jump up and down the stack.  You may also want to
try "info stack [n]" to view more info about the local variables among
other things.

To examine use "info heap".

I recommend reading the official gdb manual for more infos and
details. <http://physics.usask.ca/~angie/ep414/labmanual/GNUdoc/gdb/gdb_toc.html>.

	\Steve
-
: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux