Skip to content

Commit e7020ea

Browse files
committed
Warn about missing Rust formatters
1 parent c14a067 commit e7020ea

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

lang_support/rust.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ def __lldb_init_module(debugger, internal_dict): # pyright: ignore
2727
wShowWindow=subprocess.SW_HIDE) # type: ignore
2828
sysroot = subprocess.check_output(command, startupinfo=si, encoding='utf-8').strip()
2929
etc = path.join(sysroot, 'lib/rustlib/etc')
30-
log.info('Loading Rust formatters from {}'.format(etc))
31-
debugger.HandleCommand("command script import '{}'".format(path.join(etc, 'lldb_lookup.py')))
32-
debugger.HandleCommand("command source -s true '{}'".format(path.join(etc, 'lldb_commands')))
30+
31+
codelldb.debugger_message('Loading Rust formatters from {}'.format(etc))
32+
lldb_lookup = path.join(etc, 'lldb_lookup.py')
33+
lldb_commands = path.join(etc, 'lldb_commands')
34+
if path.isfile(lldb_lookup):
35+
debugger.HandleCommand("command script import '{}'".format(lldb_lookup))
36+
debugger.HandleCommand("command source -s true '{}'".format(lldb_commands))
37+
else:
38+
if '-msvc' in sysroot:
39+
codelldb.debugger_message(
40+
'Could not find LLDB data formatters in your Rust toolchain. ' +
41+
'Consider installing the x86_64-pc-windows-gnu target by running `rustup target add x86_64-pc-windows-gnu`.',
42+
category='stderr')

0 commit comments

Comments
 (0)