使用货物时如何获得带有调试信息的发布版本? [英] How to get a release build with debugging information when using cargo?
本文介绍了使用货物时如何获得带有调试信息的发布版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下命令
$ cargo build
生成非优化构建调试信息.相反,
produces a non-optimized build with debugging information. On the contrary,
$ cargo build --release
生成优化的构建没有调试信息.
有没有办法生成优化的构建调试信息?我需要它来获取有意义的分析信息.
Is there a way of producing an optimized build with debugging information? I need this to get meaningful profiling information.
推荐答案
如 所示在 Cargo 文档中,修改 release
profile 以包含调试符号:
As shown in the Cargo documentation, modify the release
profile to include debugging symbols:
[profile.release]
debug = true
请注意,release
配置文件和 bench
配置文件不同.
Note that the release
profile and the bench
profile differ.
另见
或者基本上是锈迹分析"的任何热门搜索结果:
Or basically any of the top search results for "rust profiling":
这篇关于使用货物时如何获得带有调试信息的发布版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文