ARMmbed / target-mbed-gcc

DEPRECATED Base for mbed yotta compilation targets compiling with GCC
Apache License 2.0
6 stars 12 forks source link

Invalid absolute module with uvision loader (gcc arm 4.8.4) #3

Closed 0xc0170 closed 9 years ago

0xc0170 commented 9 years ago

As some of you noticed, the debugging with uvision (me using 5.14) with this target results in the loader error, so no files are shown when debugging.

I recall it used to work a while ago when I might have used older gcc version (4.7), as I noticed in the release notes for GCC 4.8 which would explain it:

DWARF4 is now the default when generating DWARF debug information. When -g is used on a platform that uses DWARF debugging information, GCC will now default to -gdwarf-4 -fno-debug-types-section. GDB 7.5, Valgrind 3.8.0 and elfutils 0.154 debug information consumers support DWARF4 by default. Before GCC 4.8 the default version used was DWARF2. To make GCC 4.8 generate an older DWARF version use -g together with -gdwarf-2 or -gdwarf-3. The default for Darwin and VxWorks is still -gdwarf-2 -gstrict-dwarf.

I checked uvision reference pages, it supports dwarf2 and dwarf3 options. I recall dwarf2 is used by default there. Therefore I quickly set -gdwarf-2 for compiler flags for gcc target, build a simple demo - which fixes this issue.

The above might help somebody to workaround the error in the loader module, but the question is - how we should fix this?

0xc0170 commented 9 years ago

@autopulated We should look at this. Got a gcc target and no pyOCD support for it :-)

autopulated commented 9 years ago

ack, let's set the default to dwarf 3, or even dwarf 2