nanomq clion 远程debug尝试

发布时间 2023-11-23 13:48:52作者: 荣锋亮

很简单因为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
  • 配置工具链

  • 配置deployment

主要配置映射

  • cmake 配置profile

  • 部署代码到remote ssh 中

  • 构建nanomq
    在remote ssh 中就行
 
mkdir build && cd build
cmake -G Ninja ..
ninja
  • 添加debug

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

  • 添加断点

rest_api.c

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

效果

说明

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

参考资料

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