V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
seedscoder
V2EX  ›  问与答

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

  •  
  •   seedscoder · 2022-11-13 17:37:43 +08:00 · 889 次点击
    这是一个创建于 500 天前的主题,其中的信息可能已经有所发展或是发生改变。

    环境:

    • Apple M1 Pro 13.0 (22A380)
    • gcc 相关版本

    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 环境编译不熟悉,求大佬们指教

    2 条回复    2022-11-13 18:39:57 +08:00
    Nitroethane
        1
    Nitroethane  
       2022-11-13 18:10:02 +08:00 via iPhone
    应该是开了 O3 编译优化,在 makefile 里把参数去掉重新编译就行
    BrettD
        2
    BrettD  
       2022-11-13 18:39:57 +08:00 via iPhone
    你是自己 make 编译的,不是用 CLion 编译的?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5247 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 09:37 · PVG 17:37 · LAX 02:37 · JFK 05:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.