From: Paul Pluzhnikov <ppluzhnikov@google.com>
To: Jean Christophe Beyler <jean.christophe.beyler@gmail.com>
Cc: David Daney <ddaney@caviumnetworks.com>, gdb@sourceware.org
Subject: Re: GDB interactions with GCC
Date: Tue, 03 Nov 2009 17:38:00 -0000 [thread overview]
Message-ID: <8ac60eac0911030938y2fba14a3na8446d61c7d497f5@mail.gmail.com> (raw)
In-Reply-To: <c568a2600911030922x1607ce68ic34acb186f0bc291@mail.gmail.com>
On Tue, Nov 3, 2009 at 9:22 AM, Jean Christophe Beyler
<jean.christophe.beyler@gmail.com> wrote:
> If so, doesn't that mean that if we want GDB on an architecture that
> does not require any stack copies, we still have to generate those
> uselessly (except for GDB ;-)) ?
You appear to be under mistaken assumption that GDB can only access stack
in the inferior process.
GDB can access *any* memory in the inferior, as well as registers. DWARF
debug info (which GCC generates) tells GDB where to find any variable. The
location (described by DWARF) could be "in register", "in memory at address
NNNN", or a complicated expression involving possibly multiple registers,
offsets and memory.
DWARF also describes how the register set changes when you step to
previous frame, so once you get to (say) frame #5, GDB knows the values
registers had in that frame, and can again (using DWARF debug info) tell you
values of parameters, locals, etc.
I think you should give http://dwarfstd.org/Dwarf3Std.php (and in particular
2.6: Location Descriptions) at least a quick read.
Cheers,
--
Paul Pluzhnikov
next prev parent reply other threads:[~2009-11-03 17:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-02 22:44 Jean Christophe Beyler
2009-11-02 23:16 ` David Daney
2009-11-03 17:22 ` Jean Christophe Beyler
2009-11-03 17:38 ` Paul Pluzhnikov [this message]
2009-11-03 17:55 ` Jean Christophe Beyler
2009-11-03 18:01 ` Daniel Jacobowitz
2009-11-03 18:09 ` Jean Christophe Beyler
2009-11-03 18:14 ` Daniel Jacobowitz
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=8ac60eac0911030938y2fba14a3na8446d61c7d497f5@mail.gmail.com \
--to=ppluzhnikov@google.com \
--cc=ddaney@caviumnetworks.com \
--cc=gdb@sourceware.org \
--cc=jean.christophe.beyler@gmail.com \
/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