Keil Logo

How to debug code build outside uVision using emake on Linux

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Author
Sahan De Silva
Posted
1-May-2018 20:20 GMT
Toolset
ARM
New! How to debug code build outside uVision using emake on Linux

I'm building my code on Linux with gcc using emake. Then I followed the steps(http://www.keil.com/support/docs/2310.htm) and loaded the .elf file with debug information in Keil. It doesn't give me the option to to do source-level debugging but pops up the disassembly window instead.

How to do source-level debugging in keil with an .elf generated on linux outside uVision ? Am I missing something ?

Author
Andrew Neil
Posted
1-May-2018 20:32 GMT
Toolset
ARM
New! RE: How to debug code build outside uVision using emake on Linux

Did you include debug information when you built the code?

The source has to be accessible to uVision while you are debugging.

See also: http://www.keil.com/forum/60239/

Author
Sahan De Silva
Posted
1-May-2018 20:42 GMT
Toolset
ARM
New! RE: How to debug code build outside uVision using emake on Linux

I included -g3 in the compiler flags.I use -O0 as optimization.

Author
Andrew Neil
Posted
1-May-2018 20:58 GMT
Toolset
ARM
New! RE: How to debug code build outside uVision using emake on Linux

Did you read the linked thread - including the external thread that it links to?

some additional options are suggested there ...

Author
Sahan De Silva
Posted
2-May-2018 15:23 GMT
Toolset
ARM
New! RE: How to debug code build outside uVision using emake on Linux

Thanks Andrew. "-g -g3 -gdwarf-3 -gstrict-dwarf" flags to GCC fixed the issue for me. Its suggested in the external thread linked.

Author
Ron Wedge
Posted
3-May-2018 05:06 GMT
Toolset
ARM
New! RE: How to debug code build outside uVision using emake on Linux

Hello Sahan,

Yes, the Dwarf portion of the elf dwarf format contains the debug information. see also:

http://www.keil.com/appnotes/docs/apnt_188.asp

Author
Sahan De Silva
Posted
7-May-2018 20:18 GMT
Toolset
ARM
New! RE: How to debug code build outside uVision using emake on Linux

I could start stepping through .cpp files. But it doesn't let me to put breakpoints in the source files(.cpp) though allowed in disassembly. when I put a break point in disassembly and hit 'RUN', cursors in both disassembly and source windows run and stop at the break-point. How to solve this issue ?

Author
Andrew Neil
Posted
9-May-2018 08:15 GMT
Toolset
ARM
New! RE: breakpoints

When you break-off into a separate thread, it's helpful to say where you've gone:

http://www.keil.com/forum/63573

Author
Sahan De Silva
Posted
15-May-2018 16:00 GMT
Toolset
ARM
New! RE: breakpoints

I'm building my code on linux and importing the .elf onto Keil to debug. I have multiple places IO function calls are used. Is there a way to do semi-hosting automatically so that I don't have to replace my existing IO functions calls(fread,fwrite,fprintf,fopen,fseek,ftell) with semi-hosting functions(semihosting_file_write,semihosting_file_read) manually.

Next Thread | Thread List | Previous Thread Start a Thread | Settings

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.