Finding and fixing bugs
Debugging tools are quite platform dependent. Here we will explain lldb
, which is available, and macOS and other Unix-like systems.
To start debugging, you will need to compile the program with debugging symbols turned on. The normal cargo debug build
is usually sufficient:
cargo build
After the program has been compiled, start the debugger:
$ sudo rust-lldb target/debug/deps/performance_polynomial3-8048e39c94dd7157
Here we reference the debugs/deps/program_name-GITHASH
copy of the program. This is necessary for now just because of how lldb works.
After running lldb
, you will see some information scroll past on startup. Then, you should be dropped into a LLDB Command Prompt:
(lldb) command source -s 0 '/tmp/rust-lldb-commands.YnRBkV' Executing commands in '/tmp/rust-lldb-commands.YnRBkV'. (lldb) command script import "/Users/andrewjohnson/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/etc/lldb_rust_formatters.py" (lldb) type summary add --no-value --python-function...