From: Accounts <accounts@sakuraindustries.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: Mark Kettenis <mark.kettenis@xs4all.nl>,
ngustavson@emacinc.com, gdb-patches@sourceware.org
Subject: Re: frame theory, was pointer madness
Date: Thu, 26 Jan 2006 23:47:00 -0000 [thread overview]
Message-ID: <43D95F88.70802@sakuraindustries.com> (raw)
In-Reply-To: <20060126224429.GA20076@nevyn.them.org>
Daniel Jacobowitz wrote:
>He's connecting to basically a standard gdbserver, poised at
>the first instruction of the program. Memory has garbage
>and/or is invalid - no MMU so reading from garbage memory
>is a bit more serious than is typical for GDB.
>
>The best thing here would be, if the stub can find out from
>the kernel what constitutes "valid" RAM, to refuse reads to
>it. Then ignore the ugliness when you type backtrace and
>don't have a stack yet - it's not real surprising that doesn't
>work!
>
>
>
This sort of issue can be a BIG problem for embedded targets (it has
been for every embedded target ive used ARM and PowerPC/MPC8XX).
Ive talked about it before in previous posts. Its worse when you use a
hardware interface for your "Stub" like a JTAG pod, BDM, or the like,
because then there is no Kernel to tell you if you have valid memory or
not (The kernel hasnt run yet). There are also times on embedded
devices when the nominal stack pointer register isnt a stack pointer
register at all (for example immediately after reset of a cpu, before
the boot code has had a chance to set up the system), and dereferences
of it are "Bad News", can cause corruption of the target under the
certain circumstances and generally make embedded systems development
hell (at that level).
On Thu, Jan 26, 2006 at 11:40:07PM +0100, Mark Kettenis wrote:
>To me, it looks like you're connecting to a buggy stub.
>
>
I dont think its fair to say these things are "Buggy Stubs" just because
GDB lately has the view there is ALWAYS a stack, which just isnt
correct. Also, the stubs probably pre-date GDB's new frame unwinding
code, so really its GDB that has changed in an incompatible way with
previously working stubs. Having to work around this in a stub is a real
pain. The issue is the stub cant determine whats a memory access
command the user wants to do, and what is an automatic GDB generated
memory access, as it does a frame unwind. So there is no nice way to
make a stub say "No Stack memory yet" even if it knew it.
Ive often thought GDB should have a "No ABI" option that completely
prevents any stack/frame unwinding operations from working, so these
sorts of problems go away when there is no ABI, and then when the user
knows the target is properly set up, the user can re-enable the targets
ABI, which allows these stack memory accesses to occur. Ive even looked
at how it could be done, but it seems a very complicated thing, and i
could never quite work out a way to achieve it. (Due to a complete lack
of understanding of the frame code).
Also, for the record, my experience is GDB does this stuff even if you
dont execute a backtrace, it is done automatically when the stub
connects. Its like it is unwinding the frame to set up a cache or
something.
Steven Johnson
next prev parent reply other threads:[~2006-01-26 23:47 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-23 20:39 gdb code review, " NZG
2006-01-23 20:48 ` Daniel Jacobowitz
2006-01-23 20:51 ` Jim Blandy
2006-01-24 17:19 ` NZG
2006-01-24 19:29 ` NZG
2006-01-24 21:27 ` Jim Blandy
2006-01-24 21:58 ` NZG
2006-01-24 22:11 ` Daniel Jacobowitz
2006-01-25 0:01 ` Jim Blandy
2006-01-25 4:41 ` Eli Zaretskii
2006-01-25 4:59 ` Jim Blandy
2006-01-25 5:25 ` Jim Blandy
2006-01-25 17:21 ` Eli Zaretskii
2006-01-25 18:49 ` Jim Blandy
2006-01-25 19:58 ` Eli Zaretskii
2006-01-25 17:15 ` Eli Zaretskii
2006-01-26 16:19 ` NZG
2006-01-26 16:43 ` Daniel Jacobowitz
2006-01-26 19:55 ` frame theory, was " NZG
2006-01-26 19:59 ` Daniel Jacobowitz
2006-01-26 20:17 ` NZG
2006-01-26 20:22 ` Daniel Jacobowitz
2006-01-26 21:21 ` Mark Kettenis
2006-01-26 21:54 ` NZG
2006-01-26 22:40 ` Mark Kettenis
2006-01-26 22:44 ` Daniel Jacobowitz
2006-01-26 23:27 ` remote connection crash, was frame theory NZG
2006-01-26 23:32 ` Daniel Jacobowitz
2006-01-26 23:42 ` Jim Blandy
2006-01-26 23:45 ` Daniel Jacobowitz
2006-01-26 23:57 ` Jim Blandy
2006-01-27 0:04 ` NZG
2006-01-30 17:02 ` 5282 gdb Eclipse MI support, was remote connection crash NZG
2006-01-26 23:47 ` Accounts [this message]
2006-01-26 23:16 ` frame theory, was pointer madness Jim Blandy
2006-01-26 23:39 ` Jim Blandy
2006-01-27 7:19 ` Eli Zaretskii
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=43D95F88.70802@sakuraindustries.com \
--to=accounts@sakuraindustries.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=mark.kettenis@xs4all.nl \
--cc=ngustavson@emacinc.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