微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用 vscode 调试 rust 程序时出错仅限 Windows

如何解决使用 vscode 调试 rust 程序时出错仅限 Windows

我正在尝试使用 vscode 调试下面的代码,但出现错误

开发环境

  • Microsoft Windows 10 家庭版 10.0.19042 内部版本 19042
  • rustc 1.49.0 (e1884a8e3 2020-12-29)
  • VScode 1.54.3
  • CodeLLDB v1.6.1
// Cargo.toml
//[dependencies]
//datafusion = "3.0.0"
//arrow = "3.0.0"
//tokio = { version = "0.2",features = ["macros","blocking","rt-core","rt-threaded","sync"] }


use std::time::{Duration,Instant};
use arrow::util::pretty;
use datafusion::error::Result;
use datafusion::prelude::*;

/// This example demonstrates executing a simple query against an Arrow data source (CSV) and
/// fetching results

#[tokio::main]
async fn main() -> Result<()> {
    println!("======== Start Program ========");
    let start = Instant::Now();

    // let res_path = r"/root/workspace/project/hello_arrow/res/sample_01.csv";

    // http://insideairbnb.com/get-the-data.html
    // listing_id,id,date,reviewer_id,reviewer_name,comments
    // Boston,Massachusetts,United States
    let res_path = r"D:\workspace\vscode\arrow_rust\res\review.01.csv";

    // create local execution context
    let mut ctx = ExecutionContext::new();
    // register csv file with the execution context
    ctx.register_csv("datatable_01",res_path,CsvReadOptions::new())?;

    // execute the query
    let sql = "SELECT count(id) from datatable_01";
    let df = ctx.sql(sql)?;
    let results = df.collect().await?;

    // print the results
    pretty::print_batches(&results)?;

    let duration = start.elapsed();

    println!("Time elapsed in expensive_function() is: {:?}",duration);
    println!("======== End Program ========");
    Ok(())
}

错误代码

configuration: {
  type: 'lldb',request: 'launch',name: 'Debug Window',program: '${workspaceRoot}/target/debug/arrow_rust.exe',args: [],cwd: '${workspaceRoot}',sourceLanguages: [ 'rust' ],__configurationTarget: 5,relativePathBase: 'd:\\workspace\\vscode\\arrow_rust'
}
Listening on port 8541
error: arrow_rust.exe :: Class 'arrow::datatypes::DataType' has a member '__0' of type 'alloc::vec::Vec<arrow::datatypes::Field>' which does not have a complete deFinition.
Debug adapter exit code=3221225620,signal=null.

程序运行正常。在 Linux 上调试相同的代码

有没有其他方法可以在 Windows 上进行调试?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?