I have been using the simulator under gdb, and I've encountered an odd
problem when trying to set a breakpoint at 'main' under gdb. The
breakpoint gets set at main+2. I suspect I am making a dumb mistake,
but I can't figure it out.
Here is the code,
.global main
main:
mov #0x1234,r4
jmp main
and the build,
msp430-gcc -mmcu=msp430x1101 -Wa,--gstabs -D_GNU_ASSEMBLER_ -c -o bkpt_test.o
bkpt_test.S
msp430-gcc -mmcu=msp430x1101 -o bkpt_test bkpt_test.o
msp430-objcopy -O ihex bkpt_test bkpt_test.ihx
msp430-objdump -DS bkpt_test >bkpt_test.lst
and the gdb session.
bash$ msp430-gdb bkpt_test
GNU gdb 5.1.1
Copyright 2002 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=msp430"...
(gdb) p/x &main
$1 = 0xfc40
(gdb) b main
Breakpoint 1 at 0xfc42: file bkpt_test.S, line 4.
(gdb)
Why is the breakpoint being set at 0xfc42 instead of 0xfc40?
thanks,
galen