cassemblycode-coveragedisassemblykeil

Export the Disassembly file(s) from Keil uVision 5


When I'm debugging in uVision 5 the Disassembly window shows the interleaved source code and assembly instructions and the index of the current executed instruction. I need this window exported in a file in order to parse it with an exported code coverage report. Although there is an option in uVision to export the code coverage report that includes the assembly instructions, I see no way to generate it with interleaved source code and assembly, or a way to export the Disassembly window that contains the interleaved code.

I observed that the listing files (.lst) make links between instructions and a line in the source file with the .loc directives, but I feel like this is too much parsing already, especially seeing uVision doing this already with the Disassembly window.


Solution

  • I found that you can use the 'fromelf' command (found in Keil_v5\ARM\ARMCLANG(or ARMCC)\bin directory to parse the .axf file (found in the directory containing object files). Options for fromelf command can be found online (specifically for interleaving C with asm you can use --interleave=source with source_path=<path-to-source-directory> and -c flags)