CLion Debugging
Jump to navigation
Jump to search
This guide will help with setting up CLion for remote debugging through dcload's GDB feature.
Setup
The following criteria must be met before following this guide:
- The specific project must be setup within CLion
- A working version of dcload-ip or dcload-serial must be available on the host system
- The target Dreamcast will need either a Broadband adapter, LAN adapter, or a Coder's cable (USB or serial cable) connected
- SSH must be configured for remote logins on the host system
Creating a debug configuration
After opening your project in CLion, click the dropdown for the current debug/run configuration and select "Edit Configurations...":
In the configuration editor window, select the + icon to create a new configuration and select "Embedded GDB Debugger":
Remote GDB Server Settings
Now that the new configuration has been created, the specific settings can now be populated to enable remote debugging sessions.
Use the following settings in the debug configuration page:
- Name: Dreamcast Debug IP/Serial (really, it's up to the user)
- Target: Your project
- Executable: Your executable for your project
- GDB: Bundled GDB (This can handle SH-4 executables)
- Upload Executable: Never
- 'target remote' args: localhost:2159 (default port for dcload's GDB instance)
- GDB Server: /path/to/dc-tool-[ip|serial]
- GDB Server args: -g -x $CMakeCurrentBuildDir$/<your executable name>.elf -c $CMakeProjectDir$ -t <IP address or /dev/tty device>
- -g: Starts dcload with GDB
- -x: Uploads and executes your binary
- -c: Points dcload to your project directory to be able to load files with "/pc/" (requires superuser)
- -t: The device dcload should target
- Advanced GDB Server Options
- Run with root privileges: Checked
Once all settings have been configured, click "Apply" and the configuration should be ready.