zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.56k stars 6.47k forks source link

Kconfig: CONFIG_DEBUG_INFO misleading/broken #52929

Open besmarsh opened 1 year ago

besmarsh commented 1 year ago

Is your enhancement proposal related to a problem? Please describe.

The Kconfig option CONFIG_DEBUG_INFO under zephyr/subsys/debug is at least misleading and seems to be broken. Going by the commit history of this option's definition, it seems that the option affects x86 only, however there is nothing in the option description to indicate this and the option is not defined in an x86-specific location. I would have expected from the option's name and description that it affected the inclusion of debug symbols (-g compiler flag) but this is not the case. Furthermore, I can't see anywhere that this option is actually used. Perhaps its use has been removed but the option definition remained by mistake?

Describe the solution you'd like

Perhaps a Kconfig option that does control the inclusion of debug symbols (-g compiler flag) would also be useful. That should probably be done as a separate issue if such an option is desirable.

Describe alternatives you've considered

Leave the option as it is in its currently misleading state.

nordicjm commented 1 year ago

CONFIG_DEBUG_OPTIMIZATIONS is the Kconfig option you are looking for that sets the -g option

besmarsh commented 1 year ago

Thanks for the quick reply, but I don't think that's true. CONFIG_DEBUG_OPTIMIZATIONS sets the -Og flag, as it's one of the optimization options, but it does not set the -g flag, which controls the inclusion of debug symbols and is somewhat unrelated to optimization. It seems that the -g flag is set regardless of optimization level (CONFIG_*_OPTIMIZATIONS).

Besides this, my points about CONFIG_DEBUG_INFO still stand.

zephyrbot commented 7 months ago

Hi @tejlmand, @jhedberg,

This issue, marked as an Enhancement, was opened a while ago and did not get any traction. It was just assigned to you based on the labels. If you don't consider yourself the right person to address this issue, please re-assing it to the right person.

Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason.

@besmarsh you are also encouraged to help moving this issue forward by providing additional information and confirming this request/issue is still relevant to you.

Thanks!

besmarsh commented 7 months ago

Looks like I missed something when I created this issue and said

I can't see anywhere that this option is actually used.

It seems it is in fact used. However, I stand by my point that it affects x86 only and that the name/description are a bit misleading, making it sound like a much more generic option if you don't know otherwise.