Add primer for rust debugging
This commit is contained in:
12
usr-jp/local/etc/lldb_vscode_rustc_primer.py
Normal file
12
usr-jp/local/etc/lldb_vscode_rustc_primer.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import subprocess
|
||||
import pathlib
|
||||
import lldb
|
||||
|
||||
# determine the sysroot for the active rust interpreter
|
||||
rustlib_etc = pathlib.Path(subprocess.getoutput('rustc --print sysroot')) / 'lib' / 'rustlib' / 'etc'
|
||||
if not rustlib_etc.exists():
|
||||
raise RuntimeError('Unable to determine rustc sysroot')
|
||||
|
||||
# load lldb_lookup.py and execute lldb_commands with the correct path
|
||||
lldb.debugger.HandleCommand(f"""command script import "{rustlib_etc / 'lldb_lookup.py'}" """)
|
||||
lldb.debugger.HandleCommand(f"""command source -s 0 "{rustlib_etc / 'lldb_commands'}" """)
|
||||
Reference in New Issue
Block a user