How to set a breakpoint inside a dependency in Rust?

Viewed 829

I'm debugging my Rust project with

rust-lldb target/debug/my_project

I can set up breakpoints directly inside my project and they're working fine, e.g.

b function_inside_my_crate
Breakpoint 1: (...)

What I can't do is set up breakpoint inside my dependency from crates.io, e.g.

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

How can I create a breakpoint inside a dependency?

1 Answers

Shepmaster answered my question in his comment. The names are mangled and they aren't always accessible with simple name match. The function name may be only a part of the full name that debugger uses. The best way to bypass this problem is to use regex name matcher, e.g.

br set -r 'function_inside_dependency'
Related