chenshenhai / blog

个人博客,没事写写玩玩~~~
145 stars 21 forks source link

VSCode调试Rust代码 #41

Open chenshenhai opened 4 years ago

chenshenhai commented 4 years ago

Rust开发

安装环境

开始调试

初始化调试项目

mkdir debug_rs

cd debug_rs

cargo init

编辑调试代码

./debug_rs/src/main.rs 文件上写入待调试代码

fn add(x: i32, y: i32) -> i32 {
    return x + y;
}

fn main() {
    let x = 123;
    let y = 456;
    let result = add(x, y);

    let result = add(result, result);
    println!("result = {}", result);
}

调试配置

debug_rs_001

debug_rs_002

debug_rs_003

debug_rs_debug