Strange debug issue: no line in the current file

I’m trying to use pio debug --interface=gdb -- -x .pioinit to debug my app. However, it seems only the first line of main function can be used as a break point, and none of the other lines can be set as a break point. The gdb keeps complaining “No line in file”.

➜  untitled1 pio debug --interface=gdb -- -x .pioinit
Reading symbols from /Users/jackie/CLionProjects/untitled1/.pio/build/H743Core/firmware.elf...
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = stlink
PlatformIO: Initializing remote target...
xPack OpenOCD x86_64 Open On-Chip Debugger 0.11.0+dev (2021-10-17-00:18)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_deassert_srst

Info : tcl server disabled
Info : telnet server disabled
Info : clock speed 1800 kHz
Info : STLINK V3J10M3B5S1 (API v3) VID:PID 0483:374F
Info : Target voltage: 3.288713
Info : stm32h7x.cpu0: Cortex-M7 r1p1 processor detected
Info : stm32h7x.cpu0: target has 8 breakpoints, 4 watchpoints
Info : starting gdb server for stm32h7x.cpu0 on pipe
Info : accepting 'gdb' connection from pipe
target halted due to debug-request, current mode: Thread 
xPSR: 0x61000000 pc: 0x1ff09c94 msp: 0x24003af8
Info : Device: STM32H74x/75x
Info : flash size probed value 2048
Info : STM32H7 flash has dual banks
Info : Bank (0) size is 1024 kb, base address is 0x08000000
Info : Device: STM32H74x/75x
Info : flash size probed value 2048
Info : STM32H7 flash has dual banks
Info : Bank (1) size is 1024 kb, base address is 0x08100000
0x1ff09c94 in ?? ()
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08006a3c msp: 0x24080000
Info : Unable to match requested speed 4000 kHz, using 3300 kHz
Info : Unable to match requested speed 4000 kHz, using 3300 kHz
Loading section .text, size 0xb0e0 lma 0x8000000
Loading section .ARM.exidx, size 0x8 lma 0x800b0e0
Loading section .data, size 0xa10 lma 0x800b0e8
Info : Padding image section 0 at 0x0800baf8 with 8 bytes (bank write end alignment)
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08006a3c msp: 0x24080000
Start address 0x8006a3c, load size 47864
Transfer rate: 28 KB/sec, 9572 bytes/write.
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08006a3c msp: 0x24080000
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08006a3c msp: 0x24080000
Temporary breakpoint 1 at 0x8008744: file src/main.cpp, line 9.
PlatformIO: Initialization completed
(gdb) PlatformIO: Resume the execution to `debug_init_break = tbreak main`
PlatformIO: More configuration options -> https://bit.ly/pio-debug
Continuing.
Note: automatically using hardware breakpoints for read-only addresses.

Temporary breakpoint 1, main () at src/main.cpp:9
9       {
(gdb) frame
#0  main () at src/main.cpp:9
9       {
(gdb) list
4       // Blinking rate in milliseconds
5       #define BLINKING_RATE     500ms
6       
7       
8       int main()
9       {
10          // configure PA_13 to DEBUG_JTMS-SWDIO
11          // configure PA_14 to DEBUG_JTCK-SWCLK
12      
13      
(gdb) b main.cpp:11
No line 11 in file "main.cpp".
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
(gdb) b main.cpp:20
No line 20 in file "main.cpp".
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
(gdb) n
Info : halted: PC: 0x08008746
halted: PC: 0x08008746
Info : halted: PC: 0x08008748
halted: PC: 0x08008748
17          DigitalOut led(PB_12);
(gdb) list
12      
13      
14      
15      
16          // Initialise the digital pin LED1 as an output
17          DigitalOut led(PB_12);
18      
19          while (true) {
20              led = !led;
21              ThisThread::sleep_for(BLINKING_RATE);
(gdb) b main.cpp:17
No line 17 in file "main.cpp".
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
(gdb) b main.cpp:20
No line 20 in file "main.cpp".
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
(gdb) n
Info : halted: PC: 0x0800874a
halted: PC: 0x0800874a
Info : halted: PC: 0x0800874c
halted: PC: 0x0800874c
Info : halted: PC: 0x0800874e
halted: PC: 0x0800874e
Info : halted: PC: 0x08008750
halted: PC: 0x08008750
Info : halted: PC: 0x08008752
halted: PC: 0x08008752
Info : halted: PC: 0x08008754
halted: PC: 0x08008754
Info : halted: PC: 0x08008756
halted: PC: 0x08008756
Info : halted: PC: 0x08008758
halted: PC: 0x08008758
Info : halted: PC: 0x0800875a
halted: PC: 0x0800875a
Info : halted: PC: 0x0800875c
halted: PC: 0x0800875c
Info : halted: PC: 0x0800800a
halted: PC: 0x0800800a
Info : halted: PC: 0x08008770
halted: PC: 0x08008770
20              led = !led;
(gdb) b src/main.cpp:20
No line 20 in file "src/main.cpp".
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
(gdb) list
15      
16          // Initialise the digital pin LED1 as an output
17          DigitalOut led(PB_12);
18      
19          while (true) {
20              led = !led;
21              ThisThread::sleep_for(BLINKING_RATE);
22          }
23      }
(gdb) frame     
#0  main () at src/main.cpp:20
20              led = !led;
(gdb) info line main
Line 9 of "src/main.cpp" starts at address 0x8008744 <main()>
   and ends at 0x8008748 <main()+4>.
(gdb) info line
Line number 10 is out of range for "src/main.cpp".
(gdb) info line 20
Line number 20 is out of range for "src/main.cpp".
(gdb) 

And when you use

b src/main.cpp:17

?

It’s the same. I also tried absolute path. None of them work.