@@ -183,7 +183,7 @@ pub trait Linker {
183
183
fn optimize ( & mut self ) ;
184
184
fn pgo_gen ( & mut self ) ;
185
185
fn control_flow_guard ( & mut self ) ;
186
- fn debuginfo ( & mut self , strip : Strip ) ;
186
+ fn debuginfo ( & mut self , strip : Strip , debugger_visualizers : & [ PathBuf ] ) ;
187
187
fn no_crt_objects ( & mut self ) ;
188
188
fn no_default_libraries ( & mut self ) ;
189
189
fn export_symbols ( & mut self , tmpdir : & Path , crate_type : CrateType , symbols : & [ String ] ) ;
@@ -611,7 +611,7 @@ impl<'a> Linker for GccLinker<'a> {
611
611
612
612
fn control_flow_guard ( & mut self ) { }
613
613
614
- fn debuginfo ( & mut self , strip : Strip ) {
614
+ fn debuginfo ( & mut self , strip : Strip , _ : & [ PathBuf ] ) {
615
615
// MacOS linker doesn't support stripping symbols directly anymore.
616
616
if self . sess . target . is_like_osx {
617
617
return ;
@@ -915,7 +915,7 @@ impl<'a> Linker for MsvcLinker<'a> {
915
915
self . cmd . arg ( "/guard:cf" ) ;
916
916
}
917
917
918
- fn debuginfo ( & mut self , strip : Strip ) {
918
+ fn debuginfo ( & mut self , strip : Strip , debugger_visualizers : & [ PathBuf ] ) {
919
919
match strip {
920
920
Strip :: None => {
921
921
// This will cause the Microsoft linker to generate a PDB file
@@ -942,6 +942,13 @@ impl<'a> Linker for MsvcLinker<'a> {
942
942
}
943
943
}
944
944
}
945
+
946
+ // This will cause the Microsoft linker to embed .natvis info for all crates into the PDB file
947
+ for path in debugger_visualizers {
948
+ let mut arg = OsString :: from ( "/NATVIS:" ) ;
949
+ arg. push ( path) ;
950
+ self . cmd . arg ( arg) ;
951
+ }
945
952
}
946
953
Strip :: Debuginfo | Strip :: Symbols => {
947
954
self . cmd . arg ( "/DEBUG:NONE" ) ;
@@ -1124,7 +1131,7 @@ impl<'a> Linker for EmLinker<'a> {
1124
1131
1125
1132
fn control_flow_guard ( & mut self ) { }
1126
1133
1127
- fn debuginfo ( & mut self , _strip : Strip ) {
1134
+ fn debuginfo ( & mut self , _strip : Strip , _ : & [ PathBuf ] ) {
1128
1135
// Preserve names or generate source maps depending on debug info
1129
1136
self . cmd . arg ( match self . sess . opts . debuginfo {
1130
1137
DebugInfo :: None => "-g0" ,
@@ -1315,7 +1322,7 @@ impl<'a> Linker for WasmLd<'a> {
1315
1322
1316
1323
fn pgo_gen ( & mut self ) { }
1317
1324
1318
- fn debuginfo ( & mut self , strip : Strip ) {
1325
+ fn debuginfo ( & mut self , strip : Strip , _ : & [ PathBuf ] ) {
1319
1326
match strip {
1320
1327
Strip :: None => { }
1321
1328
Strip :: Debuginfo => {
@@ -1450,7 +1457,7 @@ impl<'a> Linker for L4Bender<'a> {
1450
1457
1451
1458
fn pgo_gen ( & mut self ) { }
1452
1459
1453
- fn debuginfo ( & mut self , strip : Strip ) {
1460
+ fn debuginfo ( & mut self , strip : Strip , _ : & [ PathBuf ] ) {
1454
1461
match strip {
1455
1462
Strip :: None => { }
1456
1463
Strip :: Debuginfo => {
@@ -1600,7 +1607,7 @@ impl<'a> Linker for PtxLinker<'a> {
1600
1607
self . cmd . arg ( "-L" ) . arg ( path) ;
1601
1608
}
1602
1609
1603
- fn debuginfo ( & mut self , _strip : Strip ) {
1610
+ fn debuginfo ( & mut self , _strip : Strip , _ : & [ PathBuf ] ) {
1604
1611
self . cmd . arg ( "--debug" ) ;
1605
1612
}
1606
1613
@@ -1699,7 +1706,7 @@ impl<'a> Linker for BpfLinker<'a> {
1699
1706
self . cmd . arg ( "-L" ) . arg ( path) ;
1700
1707
}
1701
1708
1702
- fn debuginfo ( & mut self , _strip : Strip ) {
1709
+ fn debuginfo ( & mut self , _strip : Strip , _ : & [ PathBuf ] ) {
1703
1710
self . cmd . arg ( "--debug" ) ;
1704
1711
}
1705
1712
0 commit comments