M1 版 Mac 上使用 Clion 源码启动 Redis,出现断点不生效问题,求解决方法

2022-11-13 17:37:43 +08:00
 seedscoder

环境:

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

928 次点击
所在节点    问与答
5 条回复
Nitroethane
2022-11-13 18:10:02 +08:00
应该是开了 O3 编译优化,在 makefile 里把参数去掉重新编译就行
BrettD
2022-11-13 18:39:57 +08:00
你是自己 make 编译的,不是用 CLion 编译的?
chenshun00
14 天前
最近尝试了一下确实不能 debug ,断点没有生效
seedscoder
13 天前
@chenshun00 你好,这个应该是不同版本的 Redis 里面的 makefile 修改了东西,如果你想不做任何改动,就能够断点调试,你可以切换到 6.x ,我但是是从 7.x 切换到 6.x 就可以。
chenshun00
13 天前
@seedscoder 我试了一下 7.0 ,clion 和 vscode 都 debug 了一下,确实不行,有时间我尝试一下 6.0.

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/894897

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX