GDB and unresolved breakpoints (RedBoot, compiled under Cygwin)

Tarmo Kuuse tarmo.kuuse at proekspert.ee
Thu Jan 8 12:48:02 UTC 2009


Hi!

We are developing RedBoot (boot loader for eCos) for MCF5208 using the 
Windows personal edition of 4.3-79 ELF toolchain. eCos requires a Unix 
build environment, so we build it under Cygwin. The build works and the 
resulting RedBoot runs just fine.

The problem is debugging RedBoot in Eclipse. It seems like GDB fails to 
understand absolute source file locations provided in ".debug" section.

For example: eCos source tree contains 3 different files named 
"eth_drv.c" in different directories. When setting a breakpoint, Eclipse 
displays a small yellow exclamation mark and message "Unresolved 
breakpoint". When stepping, display suddenly jumps from the correct file 
to the first instance of "eth_drv.c" it finds in the directory tree. It 
is not the file that was compiled. After that, stepping kind of goes 
haywire.

I don't understand why this is happening. GDB should know exactly which 
source file was used. ELF object's debug section contains the correct 
absolute file location. I checked that using the dwarfdump tool.

The absolute path is in unix format (because it's built in cygwin) 
"/ecos-c/foo/bar.c". Could this be the culprit?

Compiler and linker get options "-ggdb" and "-O0". These are full 
compiler options:

-mcpu=5208 -fno-use-cxa-atexit -isystem 
/ecos-c/Tools/CodeSourcery/SourceryG++/lib/gcc/m68k-elf/4.3.2/include/ 
-isystem 
/ecos-c/Tools/CodeSourcery/SourceryG++/lib/gcc/m68k-elf/4.3.2/include-fixed/ 
-malign-int -Wall -Wpointer-arith -Winline -Wundef -Woverloaded-virtual 
-ggdb -O0 -fno-rtti -fno-exceptions

I have uploaded a file which contains dwarfdump output for the module in 
question:

http://www.hot.ee/tarmospam/dwarfdump_redboot_eth_drv.txt

I am used to working on targets without debugger support. It's OK when 
there is no hope. However, it is quite annoying to come so close to a 
proper debug environment and then stumble over something this small.

--
Kind regards,
Tarmo Kuuse

Proekspert AS
tarmo.kuuse at proekspert.ee



More information about the coldfire-gnu-discuss mailing list