From: "Steve Graegert" <graegerts@gmail.com>
To: linux-c-programming@vger.kernel.org
Subject: Re: Runtime memory organization for a process
Date: Fri, 24 Mar 2006 14:10:48 +0100 [thread overview]
Message-ID: <6a00c8d50603240510x3da819dck76ab142447d08e8f@mail.gmail.com> (raw)
In-Reply-To: <3ce33f6c0603240444m39ffb49bk7540a291a0959ade@mail.gmail.com>
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
prev parent reply other threads:[~2006-03-24 13:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-24 12:44 Runtime memory organization for a process Shrikanth Ramanath
2006-03-24 13:10 ` Steve Graegert [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6a00c8d50603240510x3da819dck76ab142447d08e8f@mail.gmail.com \
--to=graegerts@gmail.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).