[Docs] Add CLion GDB Remote Debugging Support via Docker#43
[Docs] Add CLion GDB Remote Debugging Support via Docker#43YoungHypo wants to merge 8 commits intobytedance:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive support for CLion GDB remote debugging of VIDEX using Docker containers. It enables developers to set up an isolated debugging environment with proper tooling and SSH connectivity for remote debugging workflows.
- Added Docker-based debug environment with GCC 9.3.0, Bison 3.4.2, GDB, and SSH server configuration
- Created debug initialization script to set up the MySQL and VIDEX environment inside containers
- Provided step-by-step documentation guide with configuration screenshots for CLion setup
Reviewed changes
Copilot reviewed 3 out of 13 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
build/Dockerfile.debug_env |
Multi-stage Docker build that creates debug environment with custom GCC/Bison builds, debugging tools (GDB, gdbserver), and SSH server for remote debugging |
build/debug.sh |
Initialization script that starts SSH service, copies VIDEX storage engine, creates necessary directories, and sets up MySQL configuration |
doc/debug_guide.md |
Complete debugging guide covering Docker setup, CLion configuration (SSH, toolchain, deployment, CMake), MySQL initialization, and GDB debugging workflow |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
build/Dockerfile.debug_env
Outdated
| && make install-strip DESTDIR=/gcc-install \ | ||
| && cd /build && rm -rf * | ||
|
|
||
| # build Bison |
There was a problem hiding this comment.
Trailing whitespace: Line 31 has trailing whitespace after "Bison" that should be removed for consistency.
| # build Bison | |
| # build Bison |
build/Dockerfile.debug_env
Outdated
| # configure SSH | ||
| RUN mkdir -p /var/run/sshd && \ | ||
| echo 'root:root' | chpasswd && \ |
There was a problem hiding this comment.
Security concern: The root password is hardcoded as 'root' (line 113). While this is a debug environment, consider documenting this security consideration in the debug guide or suggesting that users change the password in production-like environments.
| # configure SSH | |
| RUN mkdir -p /var/run/sshd && \ | |
| echo 'root:root' | chpasswd && \ | |
| # SECURITY WARNING: | |
| # The root password is set via the ROOT_PASSWORD build argument (default: 'root'). | |
| # DO NOT use the default password in production or internet-accessible environments. | |
| # Always override ROOT_PASSWORD at build time for any non-debug use: | |
| # docker build --build-arg ROOT_PASSWORD=your_strong_password -f Dockerfile.debug_env . | |
| ARG ROOT_PASSWORD=root | |
| RUN mkdir -p /var/run/sshd && \ | |
| echo "root:${ROOT_PASSWORD}" | chpasswd && \ |
doc/debug_guide.md
Outdated
|
|
||
| ## 1. Preparation | ||
|
|
||
| Please following the instructions in **Section1 Preparation** in the [installation guide](https://github.com/bytedance/videx/blob/main/doc/installation.md). |
There was a problem hiding this comment.
Grammar error: "following" should be "follow". The sentence should read "Please follow the instructions..."
| Please following the instructions in **Section1 Preparation** in the [installation guide](https://github.com/bytedance/videx/blob/main/doc/installation.md). | |
| Please follow the instructions in **Section1 Preparation** in the [installation guide](https://github.com/bytedance/videx/blob/main/doc/installation.md). |
doc/debug_guide.md
Outdated
|
|
||
| ## 1. Preparation | ||
|
|
||
| Please following the instructions in **Section1 Preparation** in the [installation guide](https://github.com/bytedance/videx/blob/main/doc/installation.md). |
There was a problem hiding this comment.
Formatting issue: "Section1" should have a space to read "Section 1" to match the actual section format in the installation guide (which uses "## 1. Preparation").
| Please following the instructions in **Section1 Preparation** in the [installation guide](https://github.com/bytedance/videx/blob/main/doc/installation.md). | |
| Please following the instructions in **Section 1 Preparation** in the [installation guide](https://github.com/bytedance/videx/blob/main/doc/installation.md). |
doc/debug_guide.md
Outdated
|
|
||
| Open the local `mysql_server` project. | ||
|
|
||
| ### 4. Configure Remote Development Environment |
There was a problem hiding this comment.
Inconsistent section numbering: Section 3 is followed by section 4, but section 4 appears at the same heading level as section 3. Section 4 should be "## 4." instead of being nested under section 3.
| ### 4. Configure Remote Development Environment | |
| ## 4. Configure Remote Development Environment |
build/debug.sh
Outdated
| exit 1 | ||
| fi | ||
|
|
||
| [ ! -d "$MYSQL_BUILD_DIR" ] && echo "MySQL build directory not found!" && exit 1 |
There was a problem hiding this comment.
Logic error: This check on line 34 is unreachable. The script creates $MYSQL_BUILD_DIR on line 24, so this directory will always exist by the time line 34 is reached. If the intent is to verify the directory exists before creating subdirectories, this check should be moved before line 24.
| [ ! -d "$MYSQL_BUILD_DIR" ] && echo "MySQL build directory not found!" && exit 1 |
build/debug.sh
Outdated
| [ ! -d "$MYSQL_BUILD_DIR" ] && echo "MySQL build directory not found!" && exit 1 | ||
| [ ! -f "$MYSQL_BUILD_DIR/etc/my.cnf" ] && echo "my.cnf not found!" && exit 1 No newline at end of file |
There was a problem hiding this comment.
Logic error: This check on line 35 is also unreachable. The script copies my.cnf to $MYSQL_BUILD_DIR/etc/my.cnf on line 28 and exits if the source file doesn't exist (line 31). By the time line 35 is reached, the file is guaranteed to exist. This check is redundant.
| [ ! -d "$MYSQL_BUILD_DIR" ] && echo "MySQL build directory not found!" && exit 1 | |
| [ ! -f "$MYSQL_BUILD_DIR/etc/my.cnf" ] && echo "my.cnf not found!" && exit 1 | |
| [ ! -d "$MYSQL_BUILD_DIR" ] && echo "MySQL build directory not found!" && exit 1 |
|
|
||
| # Application ports: | ||
| # 13308 - MySQL service | ||
| # 5001 - Videx service |
There was a problem hiding this comment.
Trailing whitespace: Line 120 has trailing whitespace after "Videx service" that should be removed for consistency.
| # 5001 - Videx service | |
| # 5001 - Videx service |
Pull Request Summary
This PR provides support for CLion GDB remote debugging VIDEX, using Docker containers to isolate the development environment and facilitate efficient debugging and development workflows.
Related Issues
Resolves: #34
Detailed Description
Add 3 new files
build/Dockerfile.debug_env)build/debug.sh)doc/debug_guide.md)check the debug guide