ELF with source code - how to generate

PlatformIO used to generate ELF files with the source code in it. The ones I generated today for the LPC1768 and the DUE don’t have the source code included.

How do i get that back?

Please eloborate on how the ELF file “has source code” in it. Can you show an example of what you mean? ELF files are executable images, they contain the machine code (.text) and other constant data and objects. There is no C/C++ source code text inside them (well, the compiled version of them). Or are you talking about debug symbols which your debugger may use to find the source code line? Or do you mean the assembly code for the ELF file?

Here’s one with the debugging info in it.

Here’s one without.

Have you tried adding the line build_flags = -g -ggdb to your platformio.ini?

1 Like


Thanks for the help. It’s much appreciated.