Skip to content

build_unflags not working on "libs" directories (rtos, USB, etc) #13

@stefaandesmet2003

Description

@stefaandesmet2003

Hi,
I'm using the platformIO extension in VS Code, and building a debug version of the mbed-rtos example code, using the platformio.ini below, setting extra debug flags, and unsetting the defaults.

The flags are applied to the "core" files, main.c etc, but not to the "rtos" files. As a result I cannot properly debug into these files.

In BLUEPILL_F103C8.json these files are under the "libs" element.
The same behavior occurs with the USBDevice files, which are also under "libs" (that's how i came across this problem; I was playing around with the USBDevice stack on bluepill and needed debugging on the usb files).

[env:bluepill_f103c8_debug]
platform = ststm32
framework = mbed
board = bluepill_f103c8
build_flags = -DPIO_FRAMEWORK_MBED_RTOS_PRESENT, -g3, -Og
build_unflags = -Os, -O1, -O2, -O3, -g1

excerpt from the verbose build :

arm-none-eabi-g++ -o .pioenvs/bluepill_f103c8_debug/lib7ec/rtos/ThisThread.o -c -std=gnu++98 -fno-rtti -Wvla -g3 -Og -mcpu=cortex-m3 -mthumb -c -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fmessage-length=0 -fno-exceptions -fno-builtin -ffunction-sections -fdata-sections -funsigned-char -MMD -fno-delete-null-pointer-checks -fomit-frame-pointer -Os -DNDEBUG -g1 -include mbed_config.h -DPLATFORMIO=30604 ...

arm-none-eabi-g++ -o .pioenvs/bluepill_f103c8_debug/lib7ec/rtos/Thread.o -c -std=gnu++98 -fno-rtti -Wvla -g3 -Og -mcpu=cortex-m3 -mthumb -c -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fmessage-length=0 -fno-exceptions -fno-builtin -ffunction-sections -fdata-sections -funsigned-char -MMD -fno-delete-null-pointer-checks -fomit-frame-pointer -Os -DNDEBUG -g1 -include mbed_config.h -DPLATFORMIO=30604 ...

arm-none-eabi-g++ -o .pioenvs/bluepill_f103c8_debug/src/main.o -c -std=gnu++98 -fno-rtti -Wvla -g3 -Og -mcpu=cortex-m3 -mthumb -c -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fmessage-length=0 -fno-exceptions -fno-builtin -ffunction-sections -fdata-sections -funsigned-char -MMD -fno-delete-null-pointer-checks -fomit-frame-pointer -DNDEBUG -include mbed_config.h -DPLATFORMIO=30604 ...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions