-
Notifications
You must be signed in to change notification settings - Fork 25
[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?
Changes from 7 commits
b6dc8e7
cb86c0b
db1e9e6
40e355d
3770f47
d47b5a6
91e1eec
20265a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,125 @@ | ||||||||||||||||||||||||
| # build GCC | ||||||||||||||||||||||||
| FROM debian:bullseye AS gcc-builder | ||||||||||||||||||||||||
| ENV GCC_VERSION=9.3.0 | ||||||||||||||||||||||||
| RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||||||||||||||||||||||||
| build-essential wget \ | ||||||||||||||||||||||||
| libgmp-dev libmpfr-dev libmpc-dev \ | ||||||||||||||||||||||||
| && apt-get clean && rm -rf /var/lib/apt/lists/* | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| WORKDIR /build | ||||||||||||||||||||||||
| RUN wget https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.gz \ | ||||||||||||||||||||||||
| && tar -xf gcc-${GCC_VERSION}.tar.gz \ | ||||||||||||||||||||||||
| && cd gcc-${GCC_VERSION} \ | ||||||||||||||||||||||||
| && mkdir build && cd build \ | ||||||||||||||||||||||||
| && ../configure \ | ||||||||||||||||||||||||
| --prefix=/usr/local/gcc-${GCC_VERSION} \ | ||||||||||||||||||||||||
| --disable-multilib \ | ||||||||||||||||||||||||
| --enable-languages=c,c++ \ | ||||||||||||||||||||||||
| --disable-bootstrap \ | ||||||||||||||||||||||||
| --disable-nls \ | ||||||||||||||||||||||||
| --disable-libsanitizer \ | ||||||||||||||||||||||||
| --disable-libvtv \ | ||||||||||||||||||||||||
| --disable-libssp \ | ||||||||||||||||||||||||
| --disable-libquadmath \ | ||||||||||||||||||||||||
| --disable-libgomp \ | ||||||||||||||||||||||||
| --disable-libada \ | ||||||||||||||||||||||||
| --disable-libstdcxx-pch \ | ||||||||||||||||||||||||
| && make -j $(nproc) \ | ||||||||||||||||||||||||
| && make install-strip DESTDIR=/gcc-install \ | ||||||||||||||||||||||||
| && cd /build && rm -rf * | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| # build Bison | ||||||||||||||||||||||||
| FROM debian:bullseye AS bison-builder | ||||||||||||||||||||||||
| ENV BISON_VERSION=3.4.2 | ||||||||||||||||||||||||
| RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||||||||||||||||||||||||
| build-essential wget \ | ||||||||||||||||||||||||
| flex \ | ||||||||||||||||||||||||
| m4 \ | ||||||||||||||||||||||||
| && apt-get clean && rm -rf /var/lib/apt/lists/* | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| WORKDIR /build | ||||||||||||||||||||||||
| RUN wget --no-check-certificate https://ftp.gnu.org/gnu/bison/bison-${BISON_VERSION}.tar.gz \ | ||||||||||||||||||||||||
| && tar -xf bison-${BISON_VERSION}.tar.gz \ | ||||||||||||||||||||||||
| && cd bison-${BISON_VERSION} \ | ||||||||||||||||||||||||
| && ./configure --prefix=/usr/local \ | ||||||||||||||||||||||||
| && make -j $(nproc) \ | ||||||||||||||||||||||||
| && make install DESTDIR=/bison-install \ | ||||||||||||||||||||||||
| && cd /build && rm -rf * | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| # final stage | ||||||||||||||||||||||||
| FROM debian:bullseye | ||||||||||||||||||||||||
| COPY --from=gcc-builder /gcc-install/usr/local/gcc-9.3.0 /usr/local/gcc-9.3.0 | ||||||||||||||||||||||||
| COPY --from=bison-builder /bison-install/usr/local/bin/bison /usr/local/bin/bison | ||||||||||||||||||||||||
| COPY --from=bison-builder /bison-install/usr/local/lib/liby.* /usr/local/lib/ | ||||||||||||||||||||||||
| COPY --from=bison-builder /bison-install/usr/local/share/bison /usr/local/share/bison | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| # online required part | ||||||||||||||||||||||||
| RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||||||||||||||||||||||||
| cmake \ | ||||||||||||||||||||||||
| curl \ | ||||||||||||||||||||||||
| python3.9 \ | ||||||||||||||||||||||||
| python3.9-dev \ | ||||||||||||||||||||||||
| python3.9-venv \ | ||||||||||||||||||||||||
| libgmp10 \ | ||||||||||||||||||||||||
| libmpfr6 \ | ||||||||||||||||||||||||
| libmpc3 \ | ||||||||||||||||||||||||
| m4 \ | ||||||||||||||||||||||||
| pkg-config \ | ||||||||||||||||||||||||
| git \ | ||||||||||||||||||||||||
| git-lfs \ | ||||||||||||||||||||||||
| libssl-dev \ | ||||||||||||||||||||||||
| libreadline-dev \ | ||||||||||||||||||||||||
| zlib1g-dev \ | ||||||||||||||||||||||||
| libcurl4-openssl-dev \ | ||||||||||||||||||||||||
| libldap2-dev \ | ||||||||||||||||||||||||
| libsasl2-dev \ | ||||||||||||||||||||||||
| libsasl2-modules-gssapi-mit \ | ||||||||||||||||||||||||
| libkrb5-dev \ | ||||||||||||||||||||||||
| libnuma-dev \ | ||||||||||||||||||||||||
| libmecab-dev \ | ||||||||||||||||||||||||
| libaio-dev \ | ||||||||||||||||||||||||
| libncurses-dev \ | ||||||||||||||||||||||||
| libtirpc-dev \ | ||||||||||||||||||||||||
| gdb \ | ||||||||||||||||||||||||
| gdbserver \ | ||||||||||||||||||||||||
| openssh-server \ | ||||||||||||||||||||||||
| net-tools \ | ||||||||||||||||||||||||
| rsync \ | ||||||||||||||||||||||||
| && apt-get clean && rm -rf /var/lib/apt/lists/* | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| # configure Python and other tools | ||||||||||||||||||||||||
| RUN ln -sf /usr/local/gcc-9.3.0/bin/gcc /usr/local/bin/gcc \ | ||||||||||||||||||||||||
| && ln -sf /usr/bin/python3.9 /usr/bin/python3 \ | ||||||||||||||||||||||||
| && ln -sf /usr/bin/python3.9 /usr/bin/python \ | ||||||||||||||||||||||||
| && curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \ | ||||||||||||||||||||||||
| && python3.9 get-pip.py \ | ||||||||||||||||||||||||
| && rm get-pip.py | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| # validation | ||||||||||||||||||||||||
| RUN gcc --version | grep "9.3.0" \ | ||||||||||||||||||||||||
| && bison --version \ | ||||||||||||||||||||||||
| && curl --version | grep "curl" \ | ||||||||||||||||||||||||
| && python3.9 --version | grep "3.9" \ | ||||||||||||||||||||||||
| && cmake --version | grep "cmake version" \ | ||||||||||||||||||||||||
| && gdb --version | grep "GNU gdb" \ | ||||||||||||||||||||||||
| && rsync --version | grep "rsync" \ | ||||||||||||||||||||||||
| && echo "All version checks passed!" | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| ENV PATH=/usr/local/gcc-9.3.0/bin:/opt/tiger/typhoon-blade:/opt/common_tools:$PATH | ||||||||||||||||||||||||
| ENV LD_LIBRARY_PATH=/usr/local/gcc-9.3.0/lib64 | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| # configure SSH | ||||||||||||||||||||||||
| RUN mkdir -p /var/run/sshd && \ | ||||||||||||||||||||||||
| echo 'root:root' | chpasswd && \ | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
| # 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 && \ |
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 |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,35 @@ | ||||||||
| #!/usr/bin/env bash | ||||||||
| SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||||||||
| source "${SCRIPT_DIR}/config.sh" | ||||||||
|
|
||||||||
| # Error handling | ||||||||
| set -e # Exit on error | ||||||||
| set -x # Print commands for debugging | ||||||||
|
|
||||||||
| # Start SSH service | ||||||||
| /etc/init.d/ssh restart | ||||||||
|
|
||||||||
| # Copy videx to storage | ||||||||
| if [ -d "$MYSQL_HOME/storage/videx" ]; then | ||||||||
| echo "Videx directory already exists. Skipping copy." | ||||||||
| else | ||||||||
| echo "Copying videx to $MYSQL_HOME/storage..." | ||||||||
| cp -r "$VIDEX_HOME/src/mysql/videx" "$MYSQL_HOME/storage" | ||||||||
| fi | ||||||||
|
|
||||||||
| BOOST_DIR=$MYSQL_HOME/boost | ||||||||
|
|
||||||||
| # Create necessary directories | ||||||||
| mkdir -p "$BOOST_DIR" | ||||||||
| mkdir -p "$MYSQL_BUILD_DIR"/{etc,build,lib64,data,log} | ||||||||
|
|
||||||||
| # Copy my.cnf to build directory | ||||||||
| if [ -f "$SCRIPT_DIR/my.cnf" ]; then | ||||||||
| cp "$SCRIPT_DIR/my.cnf" "$MYSQL_BUILD_DIR/etc/my.cnf" | ||||||||
| else | ||||||||
| echo "Warning: my.cnf not found!" | ||||||||
| exit 1 | ||||||||
| fi | ||||||||
|
|
||||||||
| [ ! -d "$MYSQL_BUILD_DIR" ] && echo "MySQL build directory not found!" && exit 1 | ||||||||
|
||||||||
| [ ! -d "$MYSQL_BUILD_DIR" ] && echo "MySQL build directory not found!" && exit 1 |
Outdated
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 |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,167 @@ | ||||||||||
| # CLion GDB Remote Debugging VIDEX Guide | ||||||||||
|
|
||||||||||
| This guide shows how to mount the `MySQL8` and `videx` projects into a container using Docker, creating a debugging environment isolated from the host environment. The code in the container can be affected by local modifications in real-time, facilitating development and debugging. | ||||||||||
|
|
||||||||||
| **Note: This guide is currently only applicable for macOS.** | ||||||||||
|
|
||||||||||
| ## 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 **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). |
Outdated
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). |
Outdated
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 |
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.