libhal-google / libhal-armcortex

A collection of drivers and libraries for the Cortex M series ARM processors using libhal
Apache License 2.0
5 stars 3 forks source link

:technologist: Add debug info to all builds #121

Closed kammce closed 1 year ago

kammce commented 1 year ago

CMake only adds the -g debug info flag for the "Debug" build type. This makes sense for libraries deployed on a server or computer but not an embedded system. The elf file is not what is executed but the .bin or .hex file generated from it. Those generated files have all extra debug info eliminated. Because of this, each build type can have debug information without degrading performance or increasing code size. The benefit is that users can use an on chip debugger and step into this libraries APIs to inspect possible issues or hidden registers.