Most of the gdb commands are pretty similar. Shouldnt be much of a problem from tool to tool.
There will be slight differences but not too different.
My gdb command set for flashing the bluepill board is this.
target extended-remote /dev/cu.usbmodemBFDEA5F1
the "/dev/... section" is the gdb server connection of the BMP,
the "monitor swdp_scan" scans for all devices on the SWD chain.
"attach 1" attaches the debugger to the first device in the discovered chain.
load flashes the firmware binary to the attached device and quits the gdb connection
It might seem a little bit daunting as first, but it is pretty easy once you get the hang of it.
Try --help for the gdb to get a list of all the commands. Try google for "St-link + gdb" or ""St-link + openocd"
to get a more detailed understanding.
Start off with debugging outside of platformio and then emulate the same from within. It is going to be very confusing if you try to achieve both at once. Reduce the number of unknowns and variables for you to work.