Skip to content

Instantly share code, notes, and snippets.

@leolovenet
Last active May 5, 2022 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leolovenet/4b04f9d1e43358832a312490e620b8a4 to your computer and use it in GitHub Desktop.
Save leolovenet/4b04f9d1e43358832a312490e620b8a4 to your computer and use it in GitHub Desktop.
Make vscode-lldb automatically support Rust std lib sourcemaps, add it directly to VSCode's settings.json, https://github.com/vadimcn/vscode-lldb/issues/204#issuecomment-1113981923
"lldb.launch.preRunCommands": [
"script lldb.debugger.HandleCommand('settings set target.source-map /rustc/{} \"{}/lib/rustlib/src/rust\"'.format(os.popen('rustc --version --verbose').read().split('commit-hash: ')[1].split('\\n')[0].strip(), os.popen('rustc --print sysroot').readline().strip()))"
]
@leolovenet
Copy link
Author

使 VSCode 的 vscode-lldb 扩展,调试时自动打开 Rust Standard Library 的源码

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment