4

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?

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
CodeSandwich
  • 1,601
  • 13
  • 23
  • 3
    Function names are mangled and namespaced. Use a regex breakpoint. See [How to debug a crate in rust](https://stackoverflow.com/q/27032271/155423); [Unable to set a breakpoint on main while debugging a program compiled with Rust 1.10 with GDB](https://stackoverflow.com/q/38416394/155423) – Shepmaster Feb 26 '20 at 15:15

1 Answers1

1

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'
CodeSandwich
  • 1,601
  • 13
  • 23