Closed SheldonHH closed 11 months ago
You are not supposed to run the binary with cargo, just to build it.
sorry for missing leading, the debuggee is actually a Rust file under --bin
folder, NOT binary file. I have edited the issue.
I didn't create the command on my own, it's actually the code and commands from Top Software Engineering Research Conference 2021 ACM on Programming Languages OOPLSA accepted article: Translating C to safer Rust
Cargo.toml under unsafe-counter folder
[package]
name = "laertes"
version = "0.1.0"
authors = ["Mehmet Emre <maemre2@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
# default features
default = ["profiling", "equality_solver"]
# profile certain operations
profiling = []
# use standard library hash instead of ahash
std_hash = []
# use equality-based reasoning instead of subset-based reasoning
equality_solver = []
# Enable debug symbols on release builds
[profile.release]
debug = 2
incremental = true # enable incremental compilation but keep the codegen-units as the default value to still get a fast program in the end
[dependencies]
rustc_tools_util = "0.2.0"
colored = "2.0.0"
rustfix = "0.5.1"
itertools = "0.9.0"
log = "0.4"
string_cache = "0.8"
lazy_static = "1.4"
env_logger = "0.8"
ahash = "0.7.2"
clap = "2.33.3"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
regex = "1.5"
Your launch config should be something like this:
{
"version": "0.2.0",
"configurations": [
{
"sourceLanguages": ["rust"],
"type": "lldb",
"request": "launch",
"name": "Launch unsafe-counter",
"cargo": {
"args": [ "build", "--bin", "unsafe-counter"],
"filter": {
"name": "unsafe-counter",
"kind": "bin"
}
},
"args": ["/root/lab/laertes/rewrite-workspace/bzip2/rust/c2rust-lib.rs"],
"cwd": "/root/lab/unsafe-counter"
}
]
}
OS: 5.19.0-46-generic VSCode version: Version: 1.80.0 CodeLLDB version: v1.9.2 Compiler: rustc 1.49.0-nightly (e160e5cb8 2020-10-14) Debuggee: Rust file
Reference: https://zenodo.org/record/7871547 I try to debug and create breakpoints for this command.
I can execute this function successfully and able to debugging and create breakpoints in CLion + IntelliJ Rust Plugin. But errors occur in Vscode with CodeLLDB
Verbose log
launch.json