如何在Rust的依赖项中设置断点?

问题描述 投票:1回答:1

我正在调试我的Rust项目

rust-lldb target/debug/my_project

我可以直接在项目内部设置断点,但是它们工作正常,例如

b function_inside_my_crate
Breakpoint 1: (...)

例如,我无法在crates.io的依赖项中设置断点

b function_inside_dependency
Breakpoint 1: no locations (pending).
WARNING:  Unable to resolve breakpoint to any actual locations.

如何在依赖项内创建断点?

debugging rust lldb debug-symbols
1个回答
0
投票

Shepmaster在his comment中回答了我的问题。名称被整齐,并不总是可以通过简单的名称匹配来访问。函数名称可能只是调试器使用的全名的一部分。绕过此问题的最佳方法是使用正则表达式名称匹配器,例如

br set -r 'function_inside_dependency'
© www.soinside.com 2019 - 2024. All rights reserved.