使用conan包 - 调试软件包

使用conan包 - 调试软件包

本文是基于对conan官方文档Debugging packages的翻译而来, 更详细的信息可以去查阅conan官方文档。

This section shows how to setup your project and manage dependencies (i.e., install existing packages) with Conan.
本节将介绍如何使用 Conan 设置项目和管理依赖关系(即安装现有软件包)。

主目录 conan Using packages

Debugging packages

In order to run a debug session and step into the source code, the debugger needs to find the source files (or pdb files ones for Visual Studio), for Mac and Unix system the location of these files is stored inside the library itself.
为了运行调试会话并进入源代码,调试器需要找到源文件(或 Visual Studio 的 pdb 文件),对于 Mac 和 Unix 系统,这些文件的位置存储在库本身中。

Usually Conan packages don’t include these files and if they do, the path to the local cache might be different: in a typical scenario the packages are generated in a CI machine and the debug session will take place in the developers one, so the path to the sources won’t be the same.
通常 Conan 软件包不包含这些文件,如果包含,本地缓存的路径也可能不同:在典型情况下,软件包是在 CI 机器上生成的,而调试会话将在开发人员的机器上进行,因此源代码的路径不会相同。

The only rule of thumb is to compile the library we want to debug in the developer machine, and thanks to Conan this is straightforward:
唯一的经验法则是在开发者机器中编译我们要调试的库,多亏了 Conan,这一点非常简单:

conan install <reference> --build <name> --profile <debug_profile>

This command will trigger the build of the library locally in the developer’s machine, so the binaries will point to the sources where they are actually located and the debugger will find them.
该命令将在开发人员的机器上触发本地库的构建,因此二进制文件将指向它们实际所在的源代码,调试器也能找到它们。

Note
Keep updated as we are investigating more integrated solutions using hooks and for the major IDEs, Visual Studio and CLion.
我们正在研究更多使用hooksintegrated solutions,以及主要集成开发环境(Visual StudioCLion)的集成解决方案,请随时更新。

  • 13
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 24
    评论
评论 24
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值