Skip to content

Commit 7a87593

Browse files
author
Ariel Ben-Yehuda
authored
Rollup merge of rust-lang#39983 - AndrewGaspar:rust-windbg, r=brson
Adds rust-windbg.cmd script Adds rust-gdb/rust-lldb equivalent for windbg that loads the Rust .natvis files on start. This change modifies the bootstrap code to add rust-windbg to bin and the .natvis files to lib/rustlib/etc. Example usage from cmd or PowerShell: ``` rust-windbg -c "bu rs_f442289d74765418!rs::main;g" target\debug\rs.exe ```
2 parents 0777c75 + 70e6739 commit 7a87593

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

src/bootstrap/dist.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,12 @@ pub fn debugger_scripts(build: &Build,
254254
install(&build.src.join("src/etc/").join(file), &dst, 0o644);
255255
};
256256
if host.contains("windows-msvc") {
257-
// no debugger scripts
257+
// windbg debugger scripts
258+
install(&build.src.join("src/etc/rust-windbg.cmd"), &sysroot.join("bin"),
259+
0o755);
260+
261+
cp_debugger_script("natvis/libcore.natvis");
262+
cp_debugger_script("natvis/libcollections.natvis");
258263
} else {
259264
cp_debugger_script("debugger_pretty_printers_common.py");
260265

src/etc/rust-windbg.cmd

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@echo off
2+
setlocal
3+
4+
REM Copyright 2014 The Rust Project Developers. See the COPYRIGHT
5+
REM file at the top-level directory of this distribution and at
6+
REM http://rust-lang.org/COPYRIGHT.
7+
REM
8+
REM Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
9+
REM http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
10+
REM <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
11+
REM option. This file may not be copied, modified, or distributed
12+
REM except according to those terms.
13+
14+
for /f "delims=" %%i in ('rustc --print=sysroot') do set rustc_sysroot=%%i
15+
16+
set rust_etc=%rustc_sysroot%\lib\rustlib\etc
17+
18+
windbg -c ".nvload %rust_etc%\libcore.natvis;.nvload %rust_etc%\libcollections.natvis;" %*

0 commit comments

Comments
 (0)