ARMmbed / ARMmbed/mbed-os

Use O0 for better debug experience

Open
#14,865 2 comments 0 reactions 0 assignees View on GitHub
component: untriaged priority: untriaged
Dominant language
C
Stars
4.9k
Forks
3k
PR merge metrics
No merged PRs in 30d

Description

Summary of changes

Make Debug profile use optimization level -O0 instead of -O1.

Impact of changes

Previously variables in scope could have been optimized out in Mbed Studio when building with the Debug profile.
Now their values should remain visible.

> I'll close this as it can't be accepted currently due to the breaking change. Please use custom profile meanwhile.
>
> @rotu Please create a tracking issue for this change
>
> I'll close this pull request now.
>

_Originally posted by @0xc0170 in https://github.com/ARMmbed/mbed-os/issues/14562#issuecomment-871265318_

Contributor guide

Open the contributing guide

Research direction

Start by locating how the Debug profile selects its compiler optimization level for Mbed Studio and compare the current -O1 setting with the requested -O0 behavior. Confirm that variables remain visible during debugging, and check the breaking-change concern before considering the work done.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system, operating-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.