nanomq clion 远程debug尝试
  8KhYbgszLLmZ 2023年11月30日 83 0

很简单因为nanomq 是基于cmake 开发的对于clion 来说基于debug 就比较方便了,同时因为nanomq
相关依赖都是通过模块的,还是比较方便的,以下是一个简单的debug 测试

环境准备

基于clion 的remote ssh

  • clone 代码

 

git clone https://github.com/emqx/nanomq.git
cd nanomq
git submodule update --init --recursive
  • 配置工具链

nanomq clion 远程debug尝试_git

  • 配置deployment

主要配置映射

nanomq clion 远程debug尝试_git_02

  • cmake 配置profile

nanomq clion 远程debug尝试_git_03

  • 部署代码到remote ssh 中

nanomq clion 远程debug尝试_git_04

  • 构建nanomq
    在remote ssh 中就行

 

mkdir build && cd build
cmake -G Ninja ..
ninja
  • 添加debug

需要选择构建的二进制程序

nanomq clion 远程debug尝试_参考资料_05

  • 添加断点

rest_api.c

nanomq clion 远程debug尝试_github_06

  • 请求测试
curl -i --basic -u admin:public -X GET "http://10.0.8.2:8081/api/v4"

效果

nanomq clion 远程debug尝试_github_07

说明

nanomq debug 还是比较方便的,基于debug 可以很好的学习内部处理机制

参考资料

https://github.com/nanomq/nanomq
https://nanomq.io/docs/en/latest/api/v4.html

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月30日 0

暂无评论

推荐阅读
  dwHry2iKGG0I   2023年12月26日   31   0   0 githubgithubhtmlhtml
8KhYbgszLLmZ