* Runtime memory organization for a process
@ 2006-03-24 12:44 Shrikanth Ramanath
2006-03-24 13:10 ` Steve Graegert
0 siblings, 1 reply; 2+ messages in thread
From: Shrikanth Ramanath @ 2006-03-24 12:44 UTC (permalink / raw)
To: linux-c-programming
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 ??
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Runtime memory organization for a process
2006-03-24 12:44 Runtime memory organization for a process Shrikanth Ramanath
@ 2006-03-24 13:10 ` Steve Graegert
0 siblings, 0 replies; 2+ messages in thread
From: Steve Graegert @ 2006-03-24 13:10 UTC (permalink / raw)
To: linux-c-programming
On 3/24/06, Shrikanth Ramanath <shriek.007@gmail.com> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-03-24 13:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-24 12:44 Runtime memory organization for a process Shrikanth Ramanath
2006-03-24 13:10 ` Steve Graegert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).