@@ -2,7 +2,7 @@ use std::env;
22use std:: process:: Command ;
33use std:: sync:: Arc ;
44
5- use camino:: { Utf8Path , Utf8PathBuf } ;
5+ use camino:: Utf8Path ;
66
77use crate :: common:: { Config , Debugger } ;
88
@@ -54,51 +54,6 @@ pub(crate) fn configure_lldb(config: &Config) -> Option<Arc<Config>> {
5454 Some ( Arc :: new ( Config { debugger : Some ( Debugger :: Lldb ) , ..config. clone ( ) } ) )
5555}
5656
57- /// Returns `true` if the given target is a MSVC target for the purposes of CDB testing.
58- fn is_pc_windows_msvc_target ( target : & str ) -> bool {
59- target. ends_with ( "-pc-windows-msvc" )
60- }
61-
62- /// FIXME: this is very questionable...
63- fn find_cdb ( target : & str ) -> Option < Utf8PathBuf > {
64- if !( cfg ! ( windows) && is_pc_windows_msvc_target ( target) ) {
65- return None ;
66- }
67-
68- let pf86 = Utf8PathBuf :: from_path_buf (
69- env:: var_os ( "ProgramFiles(x86)" ) . or_else ( || env:: var_os ( "ProgramFiles" ) ) ?. into ( ) ,
70- )
71- . unwrap ( ) ;
72- let cdb_arch = if cfg ! ( target_arch = "x86" ) {
73- "x86"
74- } else if cfg ! ( target_arch = "x86_64" ) {
75- "x64"
76- } else if cfg ! ( target_arch = "aarch64" ) {
77- "arm64"
78- } else if cfg ! ( target_arch = "arm" ) {
79- "arm"
80- } else {
81- return None ; // No compatible CDB.exe in the Windows 10 SDK
82- } ;
83-
84- let mut path = pf86;
85- path. push ( r"Windows Kits\10\Debuggers" ) ; // We could check 8.1 etc. too?
86- path. push ( cdb_arch) ;
87- path. push ( r"cdb.exe" ) ;
88-
89- if !path. exists ( ) {
90- return None ;
91- }
92-
93- Some ( path)
94- }
95-
96- /// Returns Path to CDB
97- pub ( crate ) fn discover_cdb ( cdb : Option < String > , target : & str ) -> Option < Utf8PathBuf > {
98- let cdb = cdb. map ( Utf8PathBuf :: from) . or_else ( || find_cdb ( target) ) ;
99- cdb
100- }
101-
10257pub ( crate ) fn query_cdb_version ( cdb : & Utf8Path ) -> Option < [ u16 ; 4 ] > {
10358 let mut version = None ;
10459 if let Ok ( output) = Command :: new ( cdb) . arg ( "/version" ) . output ( ) {
0 commit comments