* Tell me about stack frames....
@ 2005-12-11 20:25 Kim Lux
2005-12-11 21:50 ` Jim Blandy
0 siblings, 1 reply; 2+ messages in thread
From: Kim Lux @ 2005-12-11 20:25 UTC (permalink / raw)
To: gdb
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Tell me about stack frames....
2005-12-11 20:25 Tell me about stack frames Kim Lux
@ 2005-12-11 21:50 ` Jim Blandy
0 siblings, 0 replies; 2+ messages in thread
From: Jim Blandy @ 2005-12-11 21:50 UTC (permalink / raw)
To: Kim Lux; +Cc: gdb
It looks like you're using a customized version of GDB 6.2, or having
GDB run a script. For example, who is printing 'entering
dbugS12_wait'?
GDB 6.2 is old; you might try a current version of GDB.
The output from 'bt' doesn't seem to ever find a valid stack frame.
Are you sure the program is even running, or that GDB is able to
properly read its registers? When you print $pc, does its value look
like a reasonable code address? Does the value of $sp seem to be a
reasonable stack address?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-12-11 21:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-11 20:25 Tell me about stack frames Kim Lux
2005-12-11 21:50 ` Jim Blandy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox