在 Windows 上调试 Redis

1. install wsl

open Microsoft Store, then search ubuntu and click to install it.

open terminal

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# list all linux subsystem
wsl --list
# set default linux subsystem, then you can input 'wsl' to inter system
wsl --set-default ubuntu
# enter default linux subsystem
wsl 
# install cmake, g++, gcc,gdb
cd /usr/local
wget https://cmake.org/files/v3.22/cmake-3.22.0-linux-x86_64.tar.gz
tar xf cmake-3.22.0-linux-x86_64.tar.gz
ln -s /usr/local/cmake-3.22.0-linux-x86_64/bin/cmake /usr/bin
sudo apt install build-essential

2. setting clion

  1. open File | Settings | Build, Execution, Deployment | Toolchains menu.
  2. add new toolchains and select wsl.

clion toolchains
clion toolchains

  1. setting wsl configuration, you maybe install cmake, gcc, g++, gdb.

  2. you must execute command git config core.autocrlf input in your terminal, because windows is CRLF, then git clone .

  3. select wsl in File | Settings | Build, Execution, Deployment | Makefile, because building redis by using makefile.

  4. login wsl and enter redis directory, for example: cd /mnt/c/Users/ooooo/Development/code/Demo/redis

  5. execute command make, you maybe need to execute cd src && ls | grep .sh | xargs chmod a+x

makefile application
makefile application

0%