- Install latest z88dk
- Dowload emulator with gdbstub, e.g. Fuse fork from speccytools.org or MAMEdev. You can also debug real hardware with Spectranet
- Launch the emulator, with Fuse, make sure gdbserver is enabled on port 1337
- Build the project. For VSCode it's Debug configuration, for CLion it's idetest | Debug
- Place a breakpoint on
sum
- Start the debugging session, (Debugging tab on VSCode, "emulator" configuration for CLion)
- z88dk-gdb should upload the binary onto the emulator
- You should see the breakpoint being hit
See how z88dk implements CMake here
mkdir build
cd build
cmake -DZCCTARGET=zx -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/z88dk/cmake/Toolchain-zcc.cmake ..
make
z88dk-gdb -x idetest.map -h <debugger host> -p <debugger-port>