-
Notifications
You must be signed in to change notification settings - Fork 20
[Docs] Add CLion GDB Remote Debugging Support via Docker #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 && \ |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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). |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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). |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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