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 ?
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/
I included -g3 in the compiler flags.I use -O0 as optimization.
Did you read the linked thread - including the external thread that it links to?
some additional options are suggested there ...
Thanks Andrew. "-g -g3 -gdwarf-3 -gstrict-dwarf" flags to GCC fixed the issue for me. Its suggested in the external thread linked.
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
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 ?
When you break-off into a separate thread, it's helpful to say where you've gone: http://www.keil.com/forum/63573
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.