I've done a little more investigation into my problems with gdb, and
thought I'd officially call it a "bug report" in the hopes that the
issues will be addressed.
Summary: for a trivial test program, the 16-bit mmio register TA0CTL
is displayed as an 8-bit value, and the global variable "timera" is
completely unknown to gdb versions 6.8/7.0.1 and gcc-4.0.2/3. I'm
using the two most recent pre-built versions of the tools available
from sf.net on a windows xp machine.
FWIW: If I change the debugging format to stabs+, then "p timera"
results in 'Address of symbol "timera" is unknown.'
I really hope I'm doing something dumb here... otherwise gdb is badly
broken and I'll have to switch toolchains *again* ... argh.
-------------------- building
~/msp430-gcc-4.4.3/bin/msp430-gcc -Wall -ggdb -g3 -mmcu=msp430x169 -o
objs_debug/gnuTest.o -c gnuTest.c > objs_debug/gnuTest.lst
~/msp430-gcc-4.4.3/bin/msp430-gcc -mmcu=msp430x169 -ggdb -g3 -o
objs_debug/gnuTest.elf objs_debug/gnuTest.o
-------------------- the file gnuTest.c
#include <io.h>
int
main()
{
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;
TACTL = TASSEL1;
timera.tar = 0;
while (1)
{
}
}
-------------------- debugging
$ msp430-gdb objs_debug/gnuTest.elf
GNU gdb (GDB) 7.0.1
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show
copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-mingw32 --target=msp430".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
0x00001100 in ?? ()
Reading symbols from M:\projects\maneMane\code\gnuTest/objs_debug/
gnuTest.elf...done.
(gdb) monitor erase main
Erasing target flash - main... Erased OK
(gdb) load
Loading section .text, size 0x4e lma 0x1100
Loading section .vectors, size 0x20 lma 0xffe0
Start address 0x1100, load size 110
Transfer rate: 3 KB/sec, 36 bytes/write.
(gdb) b main
Breakpoint 1 at 0x113a: file gnuTest.c, line 7.
(gdb) c
Continuing.
Breakpoint 1, main () at gnuTest.c:7
7 WDTCTL = WDTPW + WDTHOLD;
(gdb) n
9 TACTL = TASSEL1;
(gdb) n
11 timera.tar = 0;
(gdb) p TACTL
$1 = 0 '\000' <---------- hmm...
(gdb) x/1xh &TACTL
0x160: 0x0200 <---------- what it should be
(gdb) p timera
(gdb) No symbol "timera" in current context. <---------- yes there is!