Could not find abbrev number 79 in CU at offset 0x0

When I try to debug my stm8s105k4 in VScode I get the following error message in the debug console:
Reading symbols from C:\Users\woutc\Documents\PlatformIO\Projects\IB3_test_NRF24.pio\build\stm8sblack\firmware.elf…
Dwarf Error: Could not find abbrev number 79 in CU at offset 0x0 [in module C:\Users\woutc\Documents\PlatformIO\Projects\IB3_test_NRF24.pio\build\stm8sblack\firmware.elf]
(no debugging symbols found)…done.
PlatformIO Unified Debugger → Redirecting...
PlatformIO: debug_tool = stlink
PlatformIO: Initializing remote target…
xPack OpenOCD, x86_64 Open On-Chip Debugger 0.10.0+dev-00378-ge5be992df (2020-06-26-09:29)
Licensed under GNU GPL v2
I use this in my platform.ini:
[env:stm8sblack]
platform = ststm8
board = stm8sblack
framework = spl
upload_protocol = stlinkv2
debug_tool = stlink

The program compiles and uploads successfully to the board.
I am using an stm8s105k4 breakout board paired with an st-link v2 (from China) on windows 11.
After asking help from someone who got it working in l Linux and searching on the internet I can’t figure out how to solve this.

Looks exactly like https://github.com/platformio/platform-ststm8/issues/44 to me, but only workarounds are known at the moment. May need an SDCC upgrade.

I cannot reproduce the fix anymore by exchanging the linking order between main and stm8_gpio. Will need to update the bug report and hope for SDCC people’s support. But as it stands, their latest snapshot of the compiler doesn’t even execute.