学习Rust之window系统安装LLVM - mowatermelon/learn-rust GitHub Wiki
At the moment, Windows port of LLDB is known to work reliably only with 32-bit binaries and DWARF debug info: 目前,已知LLDB的Windows端口仅可以使用32位二进制文件和DWARF调试信息可靠地工作:
LLDB's support of MSVC .PDB debug info format is incomplete. Only DWARF debug info works reliably. LLDB对MSVC .PDB调试信息格式的支持不完整。只有DWARF调试信息可靠地工作。
The 64-bit LLDB is very unstable, so I cannot recommend using it. Unfortunately, 32-bit debuggers are limited to debugging 32-bit processes only. 64位LLDB非常不稳定,因此我不建议使用它。不幸的是,32位调试器仅限于调试32位进程。
In practice, the above means that for C++ programs, you'll need to compile with i686 MinGW toolchain (not MSVC!). For Rust you'll need to use i686-pc-windows-gnu. 实际上,上述意味着对于C ++程序,您需要使用i686 MinGW工具链(而不是MSVC!)进行编译。对于Rust,你需要使用i686-pc-windows-gnu。
The information above was correct as of mid-2017. Hopefully Windows support will improve with time. 以上信息截至2017年年中是正确的。希望Windows支持将随着时间的推移而改进。
安装步骤
- 下载LLVM and install LLVM for Windows. (您也可以尝试半官方LLVM快照构建,但LLDB会不时被破坏).
- 下载python3.7 ,安装 Python 3.7.x.,或者选择其他版本。 (请注意python和llvm的版本要一致,即要么两个都是32位的,要么两个都是64位的).
- 确保LLDB和Python安装目录都在PATH上。除非可以找到python35.dll,否则LLDB将无法启动! (或者,您可以使用工作区设置仅修改CodeLLDB的PATH)。
虽然安装过程中,可以选择自动将llvm添加到path中,但是还是存在自动添加失败的情况,所以需要在安装完成之后,检测一下环境变量是否添加成功。
如果发现没有自动添加,LLVM
默认安装的路径是%系统盘%\Program Files (x86)\LLVM
,将%系统盘%\Program Files (x86)\LLVM\bin
路径配置到系统环境变量中。
X:\XX>python -V
Python 3.7.0
X:\XX>llvm-ar
llvm-ar: Expected options.
OVERVIEW: LLVM Archiver (llvm-ar)
This program archives bitcode files into single libraries
USAGE: llvm-ar [options] [relpos] [count] <archive-file> [members]...
OPTIONS:
-M -
-aarch64-neon-syntax - Choose style of NEON code to emit from
AArch64 backend:
=generic - Emit generic NEON assembly
=apple - Emit Apple-style NEON assembly
-amdgpu-dump-comd - Dump AMDGPU Code Object Metadata
-amdgpu-verify-comd - Verify AMDGPU Code Object Metadata
-arm-add-build-attributes -
-arm-implicit-it - Allow conditional instructions outdside
of an IT block
=always - Accept in both ISAs, emit implicit IT
s in Thumb
=never - Warn in ARM, reject in Thumb
=arm - Accept in ARM, reject in Thumb
=thumb - Warn in ARM, emit implicit ITs in Thu
mb
-enable-packed-inlinable-literals - Enable packed inlinable literals (v2f16
, v2i16)
-filter-print-funcs=<function names> - Only print IR for functions whose name
match this for all print-[before|after][-all] options
-format - Archive format to create
=default - default
=gnu - gnu
=darwin - darwin
=bsd - bsd
-gpsize=<uint> - Global Pointer Addressing Size. The de
fault size is 8.
-help - Display available options (-help-hidden
for more)
-merror-missing-parenthesis - Error for missing parenthesis around pr
edicate registers
-merror-noncontigious-register - Error for register names that aren't co
ntigious
-mfuture-regs - Enable future registers
-mno-compound - Disable looking for compound instructio
ns for Hexagon
-mno-fixup - Disable fixing up resolved relocations
for Hexagon
-mno-pairing - Disable looking for duplex instructions
for Hexagon
-mwarn-missing-parenthesis - Warn for missing parenthesis around pre
dicate registers
-mwarn-noncontigious-register - Warn for register names that arent cont
igious
-mwarn-sign-mismatch - Warn for mismatching a signed and unsig
ned value
-plugin=<string> - plugin (ignored for compatibility
-print-after-all - Print IR after each pass
-print-before-all - Print IR before each pass
-rng-seed=<seed> - Seed for the random number generator
-time-passes - Time each pass, printing elapsed time f
or each on exit
-verify-debug-info -
-verify-dom-info - Verify dominator info (time consuming)
-version - Display the version of this program
-x86-asm-syntax - Choose style of code to emit from X86 b
ackend:
=att - Emit AT&T-style assembly
=intel - Emit Intel-style assembly
直接在扩展商店中搜索CodeLLDB
,插件github地址,插件github说明
CodeLLDB: a LLDB front end for Visual Studio Code
- Supports Linux, macOS and Windows (with caveats - see below).
- Launch processes with configurable stdio redirection.
- Attach to processes by pid or by name.
- Scripted custom launch for ultimate flexibility.
- Function, conditional and regex breakpoints.
- Disassembly View.
- LLDB commands and expression evaluation in Debug Console.
- Configurable result formatting.
- Display of HTML content.
- Rust language support (excluding LLDB 3.8).