This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Tell me about stack frames....


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]