Browse Source

Fixed rust debug value formatter

merge-requests/404/merge
eidheim 5 years ago
parent
commit
17a3fb4e2f
  1. 10
      src/project.cpp

10
src/project.cpp

@ -474,9 +474,13 @@ void Project::LLDB::debug_start() {
auto sysroot = ostream.str(); auto sysroot = ostream.str();
while(!sysroot.empty() && (sysroot.back() == '\n' || sysroot.back() == '\r')) while(!sysroot.empty() && (sysroot.back() == '\n' || sysroot.back() == '\r'))
sysroot.pop_back(); sysroot.pop_back();
startup_commands.emplace_back("command script import \"" + sysroot + "/lib/rustlib/etc/lldb_rust_formatters.py\""); std::string line;
startup_commands.emplace_back("type summary add --no-value --python-function lldb_rust_formatters.print_val -x \".*\" --category Rust"); std::ifstream input(sysroot + "/lib/rustlib/etc/lldb_commands", std::ofstream::binary);
startup_commands.emplace_back("type category enable Rust"); 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); Debug::LLDB::get().start(*run_arguments, *project_path, breakpoints, startup_commands, remote_host);

Loading…
Cancel
Save