STM8 Debugging Fails with STLink-V2

I am trying to get debugging work on an STM8S-Blue board using PlatformIO and an STLink-V2 clone on a Windows 11 PC. I am using the official spl-blink example. The code compiles and I am able to upload it to the board. The code runs perfectly.

What I can’t get working is the debugging. The debugging fails with the following message, in the Debug Console tab.

Processing default (platform:; board: stm8sblue; framework: spl)
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: ST STM8 (2.1.0+sha.c6af4c1) > ST STM8S103F3 Breakout Board
HARDWARE: STM8S103F3P6 16MHz, 1KB RAM, 8KB Flash
DEBUG: Current (stlink) External (stlink)
 - framework-ststm8spl @ 0.20301.181217 (2.3.1) 
 - tool-stm8binutils @ 0.230.0 (2.30) 
 - toolchain-sdcc @ 1.40200.0 (4.2.0)
LDF: Library Dependency Finder ->
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in debug mode
Checking size .pio\build\default\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   0.0% (used 0 bytes from 1024 bytes)
Flash: [=         ]   7.9% (used 650 bytes from 8192 bytes)
========================= [SUCCESS] Took 0.36 seconds =========================
Reading symbols from D:\Code\PlatformIO\STM8\Blink\.pio\build\default\firmware.elf...
Dwarf Error: Cannot find DIE at 0x4b4 referenced from DIE at 0x498 [in module D:\Code\PlatformIO\STM8\Blink\.pio\build\default\firmware.elf]
PlatformIO Unified Debugger ->
PlatformIO: debug_tool = stlink
PlatformIO: Initializing remote target...
xPack Open On-Chip Debugger 0.12.0+dev-01557-gdd1758272-dirty (2024-04-02-07:27)
Licensed under GNU GPL v2
For bug reports, read
srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst
Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.232718
Info : clock speed 800 kHz
Info : [stm8s.cpu] Examination succeed
Info : starting gdb server for stm8s.cpu on pipe
target halted due to debug-request, pc: 0x00008000
Info : tcl server disabled
Info : telnet server disabled
Info : accepting 'gdb' connection from pipe
warning: Can not parse XML target description; XML support was disabled at compile time
0x00008000 in ?? ()
Loading section HOME, size 0x6f lma 0x8000
Loading section GSINIT, size 0x1a lma 0x806f
Loading section GSFINAL, size 0x3 lma 0x8089
Loading section CONST, size 0x56 lma 0x808c
Loading section CODE, size 0x1a8 lma 0x80e2
Loading section SSEG, size 0x1 lma 0x828a
Start address 0x806f, load size 651
Transfer rate: 241 bytes/sec, 108 bytes/write.
target halted due to debug-request, pc: 0x00008000
target halted due to debug-request, pc: 0x00008000
.pioinit:17: Error in sourced command file:

Following is the platformio.ini file.

platform =
board = stm8sblue
framework = spl
upload_protocol = stlinkv2
debug_tool = stlink

I have been reading about similar errors reported here, as well as in GitHub. Is this some issue with SDCC?