How to generate ELF with debug symbols

want to make .elf file with debug symbols which debugger use to find the source code line.

I wrote “build_flags = -g -ggdb” in platformio.ini,and could make .elf file with debug symbols.

However, debugger can not retrieve data from the update of pratformIO several months ago…

Do you use Debugging — PlatformIO latest documentation? Could your share your platformio.ini?

I use STMstudio .
It run-time variables monitoring and visualization tool for STM32 microcontrollers.
And in order to use it, it have to import an elf file .

from here,platformio.ini

[env:nucleo_f401re]

platform = ststm32

board = nucleo_f401re

framework = mbed

build_flags = -g -ggdb

debug_tool = stlink

upload_protocol = stlink