环境:
gcc --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
g++ --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
Clion 配置
操作流程
git clone git clone https://github.com/redis/redis.git
make clean; make
the breakpoint will not currently be hit. no executable code is associated with this line
问题:怎样让断点生效,本人是 Javaer ,对 C 环境编译不熟悉,求大佬们指教
1
Nitroethane 2022-11-13 18:10:02 +08:00 via iPhone
应该是开了 O3 编译优化,在 makefile 里把参数去掉重新编译就行
|
2
BrettD 2022-11-13 18:39:57 +08:00 via iPhone
你是自己 make 编译的,不是用 CLion 编译的?
|
3
chenshun00 225 天前
最近尝试了一下确实不能 debug ,断点没有生效
|
4
seedscoder OP @chenshun00 你好,这个应该是不同版本的 Redis 里面的 makefile 修改了东西,如果你想不做任何改动,就能够断点调试,你可以切换到 6.x ,我但是是从 7.x 切换到 6.x 就可以。
|
5
chenshun00 224 天前
@seedscoder 我试了一下 7.0 ,clion 和 vscode 都 debug 了一下,确实不行,有时间我尝试一下 6.0.
|