Build with GCC ARM Embedded; debug with uVision

Asked by Andrew Neil

I note the introduction to the GCC ARM Embedded toolchain:

"As part of its ongoing commitment to maintaining and enhancing GCC compiler support for the ARM architecture, ARM is maintaining a GNU toolchain with a GCC source branch targeted at Embedded ARM Processors ... ARM employees are maintaining this project."

https://launchpad.net/gcc-arm-embedded/

As Keil is also now an ARM company, is it intended that uVision should be able to debug an executable built with the GCC ARM Embedded toolchain?

At the moment, when I try, I get:

   load my_file.elf

   *** error 59: invalid absolute module

This is unhelpful, as it gives no information at all on what is "invalid" about it!

http://www.keil.com/support/docs/3692.htm says:

"The error message 'invalid absolute Module' indicates a problem with the debug information loader in µVision. Unfortunately, we can't guarantee that µVision can load .ELF-Files from all 3rd party tools."

Does the GCC ARM Embedded toolchain still count as "3rd-party"?

Is there a specific set of GCC ARM Embedded options to get debug information compatible with µVision?

Thanks,

Andy.

Cross-posted on the Keil forum: http://www.keil.com/forum/60239/#msg196310

Question information

Language:
English Edit question
Status:
Answered
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Thomas Preud'homme (thomas-preudhomme) said :
#1

Hi Andrew,

As was answered on the Keil forum, although ARM is involved in GCC development, the GCC toolchain is still considered a third party to Keil since the two are developped independently. Although ARM is doing a lot of work in the GNU toolchain, other players are also contributing to the code.

Now, that being said, interoperability between different toolchains is generally desirable, it is just not guaranteed. The key here is to first determine where the problem lies. Is the GNU toolchain generating invalid DWARF information or is it an aspect of DWARF not supported by Keil. Since the error message comes from uVision, I would suggest you take contact with Keil to pinpoint what is the issue at hand. Then we can look into how to fix it. One thing you can try in the immediate is to compile with -g3 instead of -g and see if uVision can read the file fine.

Best regards

Revision history for this message
Thomas Preud'homme (thomas-preudhomme) said :
#2

By the way, Keil publishes [1] documents about what part of DWARF uVision understands so you could use that and compare with the output of arm-none-eabi-readelf --debug-dump.

[1] http://www.keil.com/appnotes/docs/apnt_188.asp

Best regards.

Revision history for this message
Andrew Neil (u-upuntu-s) said :
#3

OK, thanks.

So, although "interoperability between different toolchains is generally desirable", there is no specific work being done on this, and no particular commitment to it?

Revision history for this message
Thomas Preud'homme (thomas-preudhomme) said :
#4

As for all bug reports, we consider how serious is the issue and how difficult it is to fix and prioritize our work accordingly. Some interoperability issues have already been solved in the past so there is work done on this. If you find your issue is actually a bug in the DWARF information generated by GCC we will create an internal ticket for that and depending on the factors I mentioned above, decide whether we have resources to fix it or not.

Best regards.

Revision history for this message
Andrew Neil (u-upuntu-s) said :
#5

Sure. I'll take a look into that Keil doc and the -g options ...

https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html

Revision history for this message
steven_cooreman (steven-cooreman) said :
#6

Hi Andrew,

I don't know if you have figured it out by now, but I was having the same problem, and fixed it by supplying the following flags to GCC:

"-g -g3 -gdwarf-3 -gstrict-dwarf"

This forces GCC to generate the .elf using only DWARF v2/v3 fields, and none of the v4 or later extensions, which seemingly uVision has problems with. This worked for me, at least, and got me debug capability for a GCC-generated .elf using the uVision debug mode, including code correlation.

Revision history for this message
Andrew Neil (u-upuntu-s) said :
#7

Hi Steve,

No, I hadn't - so thanks for that!

:-)

I'll give it a try ...

Can you help with this problem?

Provide an answer of your own, or ask Andrew Neil for more information if necessary.

To post a message you must log in.