gdb seems to cast adresses of my watch variable window

I have a little problem with debugging of my arm project, which is base on a STR750 µcontroller.

I use Eclipse for this, but I encounter the same problem if I use Insight.

My toolchain is base on :

binutils-2.17

gcc-4.1.1

insight-6.5

newlib-1.14.

For the Jtag access, I use :

Open On-Chip Debugger (2007-01-31 12:00 CET)

and an olimex wiggler.

I am working on flash area, and I use a link file which specifie that the flash is at the 0x0000 0000 adresse. (On STR750, the flash is at 0x2000 0000, but can be alias at 0x0000 0000 by mean of boot configuration, and the ram is at 0x4000 0000)

My first try was with a link file with flash section at 0x2000 0000. The program was running, but I was unable to debug it, because all wishes breakpoints were cast to 0x0___ ____ by gdb. Actually, I don’t know why.

So I am now working with a new link file, with the Flash section set at 0x0000 0000.

It is better for the breakpoint, but I have now problems with viewing variable on a watch window. All variable adresse seems to be cast to 0x0___ ____ again by gdb.

For example, I add a variable myVariable on my program and I put some know value in this variable. It’s global adress taken from the map file is 0x4000 3290.

When I add this variable to the watch window, the viewing result is wrong. All values seems wrong.

But if I made a “monitor mdw 0x4000 16” on the gdb console, I can see the good result on the returned lines from openOcd.

I have add the following option “-d 3 -l openocd.log” on the openocd command, and I can clearly see that gdb is asking the wrong adress for myVariable. I have the following line on my log :

Debug:   gdb_server.c:124 gdb_get_char(): received '+'
Debug:   gdb_server.c:124 gdb_get_char(): received '$m3290,a0#f8'
Debug:   gdb_server.c:239 gdb_get_packet(): character: '

Does anybody have an idee on what I am doing wrong ?

Is there a configuration of gdb or eclipse that I am forgetting.

Thanks for any advice.
Debug: gdb_server.c:1237 gdb_input(): recevied packet: ‘m3290,a0’
Debug: gdb_server.c:834 gdb_read_memory_packet(): addr: 0x00003290, len: 0x000000a0
Debug: arm7_9_common.c:1676 arm7_9_read_memory(): address: 0x00003290, size: 0x00000004, count: 0x00000028
Debug: embeddedice.c:203 embeddedice_read_reg_w_check(): 1


Does anybody have an idee on what I am doing wrong ?

Is there a configuration of gdb or eclipse that I am forgetting.

Thanks for any advice.

Hello,

Does anybody have an idea ?

I had suspect an optimization problem, but it doesn’t seem to be my problem as I replace the -O0 by nothing and the problem is still here.

I am now looking on debug option for gcc. I use for the moment only the -g debug option. Is it enough for debugging with gdb ?

Any advice will be greatly appreciate !

I’ve found my mistake !

I used previously an mspgcc compiler for testing purpose on a

msp430 target.

I added at this time a .gdbinit on my home directory with the

following line in it :

set remoteaddresssize 16

I had just to replace 16 with 32, and all is working as it should…

Nevertheless, thank’s for your help.

Patrick.