From 17a3fb4e2f39f87d7b81fefc22025d1d54975e7d Mon Sep 17 00:00:00 2001 From: eidheim Date: Fri, 21 May 2021 11:55:36 +0200 Subject: [PATCH] Fixed rust debug value formatter --- src/project.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/project.cpp b/src/project.cpp index 799b89f..db3c335 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -474,9 +474,13 @@ void Project::LLDB::debug_start() { auto sysroot = ostream.str(); while(!sysroot.empty() && (sysroot.back() == '\n' || sysroot.back() == '\r')) sysroot.pop_back(); - startup_commands.emplace_back("command script import \"" + sysroot + "/lib/rustlib/etc/lldb_rust_formatters.py\""); - startup_commands.emplace_back("type summary add --no-value --python-function lldb_rust_formatters.print_val -x \".*\" --category Rust"); - startup_commands.emplace_back("type category enable Rust"); + std::string line; + std::ifstream input(sysroot + "/lib/rustlib/etc/lldb_commands", std::ofstream::binary); + if(input) { + startup_commands.emplace_back("command script import \"" + sysroot + "/lib/rustlib/etc/lldb_lookup.py\""); + while(std::getline(input, line)) + startup_commands.emplace_back(line); + } } } Debug::LLDB::get().start(*run_arguments, *project_path, breakpoints, startup_commands, remote_host);