🌄
Debugger for Rust: FireDBG
2024年のスタート。2024年も個人 blog を継続する。
FireDBG[1] という Rust の Debugger を試す。
tl;dr
- 現時点で調べる限りでは、FireDBG は、Apple シリコンの影響で Dev Container で動かせない。Cloud Workstations[2] で FireDBG を検証した。
-
info: completed FireDBG self tests
このメッセージが表示されれば install は完了。 -
.ss
というファイルが出力される。そのファイルを FireDBG で開くと、VS Code の画面で debug できる。
Environment
- Cloud Workstations
- OS
- Ubuntu 20.04.6 LTS
- Rust
- cargo 1.74.1 (ecb9851af 2023-10-18)
- rustc 1.74.1 (a28077b28 2023-12-04)
- rustup 1.26.0 (5af9b9484 2023-04-05)
- IDE
- Code-OSS
- OS
[3]
Getting Starteduser@rust:~/FireDBG.Rust.Testbench$ curl https://raw.githubusercontent.com/SeaQL/FireDBG.for.Rust/main/install.sh -sSf | sh
info: downloading FireDBG from `https://github.com/SeaQL/FireDBG.for.Rust/releases/download/1.74.2/x86_64-ubuntu20.04.tar.gz`
info: installing FireDBG binaries to `/home/user/.cargo/bin`
info: performing FireDBG self tests
Tracing `firedbg.toml` config file not found, default settings will be applied
Tracing debugger_self_test = { trace = "full" }
Parsed 2 source files; re-cached 2 source files
Compiling firedbg-lib v0.1.2
Compiling debugger_self_test v1.74.2 (/home/user/.cargo/bin/firedbg-lib/debugger-self-test)
Finished dev [unoptimized + debuginfo] target(s) in 1.76s
Running `LD_LIBRARY_PATH="/home/user/.cargo/bin/firedbg-lib/lib" "/home/user/.cargo/bin/firedbg-debugger" "run" "/home/user/.cargo/bin/firedbg-lib/debugger-self-test/target/debug/debugger_self_test" "--workspace-root" "/home/user/.cargo/bin/firedbg-lib/debugger-self-test" "--output" "/home/user/.cargo/bin/firedbg-lib/debugger-self-test/output.firedbg.ss" "--package-name" "debugger_self_test" "--package" "./full"`
Testing call_chain
Testing for_range
Testing hash_map
Testing return_char
Testing return_enum
Testing return_value
Testing return_object
Testing return_option
Testing return_result
Testing return_struct
Testing return_pointer
Testing return_ref_mut
Testing fn_return
info: completed FireDBG self tests
user@rust:~/FireDBG.Rust.Testbench$
- REST API の実装で使用した Axum のコードを使用。
user@rust:~/rust-api-samples-rocket/axum$ firedbg list-target
Upgrading FireDBG version
Available binaries are:
axum
user@rust:~/rust-api-samples-rocket/axum$
user@rust:~/rust-api-samples-rocket/axum$ firedbg run axum
Tracing `firedbg.toml` config file not found, default settings will be applied
Tracing axum = { trace = "full" }
Parsed 13 source files; re-cached 5 source files
Finished dev [unoptimized + debuginfo] target(s) in 0.17s
Running `LD_LIBRARY_PATH="/home/user/.cargo/bin/firedbg-lib/lib" "/home/user/.cargo/bin/firedbg-debugger" "run" "/home/user/rust-api-samples-rocket/axum/target/debug/axum" "--workspace-root" "/home/user/rust-api-samples-rocket/axum" "--output" "/home/user/rust-api-samples-rocket/axum/firedbg/target/axum-1704180031405.firedbg.ss" "--package-name" "axum" "--package" "./full"`
user@rust:~/rust-api-samples-rocket/axum$
FireDBG に関する検証は以上。
BTW
FireDBG を M1 の VSCode Dev Container で動かす方法がまだ不明。
Discussion