Running `rustc -crate-name mycrate src/main.rs -crate-type bin -emit=dep-info,link -C debuginfo=2 -C metadata=8b3e6af7e4113faf -C extra-filename=-8b3e6af7e4113faf -out-dir /home/user/programming/mycrate/target/debug/deps -L dependency=/home/user/programming/mycrate/target/debug/deps -extern log=/home/user/programming/mycrate/target/debug/deps/liblog-6d2adb16c0d397ce.rlib -extern mkv=/home/user/programming/mycrate/target/debug/deps/libmkv-391472e7b11b31e6.rlib -extern env_logger=/home/user/programming/mycrate/target/debug/deps/libenv_logger-8b11da9f68ecb368.rlib`įinished dev target(s) in 13.4 secs $ cargo build -vĬompiling mycrate v0.1.0 (file:///home/user/programming/mycrate) I haven't figured out to use LLDB with cargo install, but it's probably very similar what I'm going in this post. However, cargo install does a "release" build with is optimized and contains no debug symbols. 1 - Compile with debug symbolsīy default, cargo build creates a "debug" build that contains the debug symbols. Some of the formatting isn't quite right, so Rust's package manager cargo ships with a wrapper script for each: rust-gdb and rust-lldb that includes a python script for formatting purposes. The Rust compiler team has also embedded debug symbols using the DWARF protocol, so that means that we can use the always-fashionable GDB and LLDB. So, the main options for debugging code are (1) lean on the compiler and (2) lots of println!(), which can only get you so far.įortunately, Rust has C Application Binary Interface (ABI) compatibility so we can mostly pretend that compiled Rust is C code. ![]() Additionally, its very cumbersome to use the online playground for understanding the code I'm actually working on right now. There's no repl for Rust, so its especially important to use other techniques to interact with Rust code I believe that its unlikely there would ever be a Rust repl given the fact that Rust is a compiled language. ![]() Things are probably very different on Windows, but might be very similar on Linux and friends. I'll explain how to step through a Rust application using LLDB and illustrate some of the most basic commands.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |