tinymovr/Tinymovr

Use -g2 or -g3 for debug builds

yconst opened this issue · 3 comments

It appears that -g2 or -g3 are incompatible with __attribute__((section(".data"))) in newer gcc builds, as is discussed here.

In order to use these flags for improved debug insights, we need to conditionally move functions to RAM only in release builds. This will probably need replacing the PAC5XXX_RAMFUNC macro with one that is defined in an if block.

However this will conflict with NVM functions that need to be placed in RAM anyway.

NVM functions could be left in flash for debug builds, issuing a warning that use thereof is discouraged in debug. In any case, the incompatibility between debug flags and RAM functions seems like a pretty important issue in general.

The solution for now, as implemented in #230 is to conditionally load functions to RAM depending on whether we are in debug mode.