From: Kim Lux <lux@diesel-research.com>
To: gdb@sourceware.org
Subject: Tell me about stack frames....
Date: Sun, 11 Dec 2005 20:25:00 -0000 [thread overview]
Message-ID: <1134332748.14961.17.camel@localhost.localdomain> (raw)
I am debugging an issue in a custom gdb stub, specifically, issuing the
'bt' command in the m68hc11 stub causes gdb to go into an endless loop
unwinding the stack. I am doing this from within main().
Questions:
1) How deep should the stack be when one is in main(); ? Is main()
itself put on the stack ?
2) What should nextframe point to when one is on the last frame ?
3) Where/when are the frames initialized ?
Thanks.
Here is an example of a session that hangs gdb:
=========================================================
GNU gdb 6.2-m68hc1x-2004-08-01
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "--host=i686-pc-linux-gnu
--target=m6811-elf"...
The target architecture is assumed to be m68hc12
entering dbugS12_wait()
Wait:
S>
leaving dbugS12_wait()
[Switching to process -1]
0x0000ffff in ?? ()
Target CPU Has Been Reset
S>
All Breakpoints Removed
S>
Breakpoint 1 at 0xc03b: file test.c, line 24.
(gdb) bt
#0 0x0000ffff in ?? ()
m68hc11_unwind_pc(): returning 00FFFF
#1 0x0000ffff in ?? ()
m68hc11_unwind_pc(): returning 00FFFF
#2 0x0000ffff in ?? ()
m68hc11_unwind_pc(): returning 00FFFF
#3 0x0000ffff in ?? ()
...
======================================================================
--
Kim Lux, Diesel Research Inc.
next reply other threads:[~2005-12-11 20:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-11 20:25 Kim Lux [this message]
2005-12-11 21:50 ` Jim Blandy
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=1134332748.14961.17.camel@localhost.localdomain \
--to=lux@diesel-research.com \
--cc=gdb@sourceware.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