File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ """
2
+ LLDB Helpers for working with the swift compiler.
3
+
4
+ Load into LLDB with 'command script import /path/to/lldbToolBox.py'
5
+
6
+ This will also import LLVM data formatters as well, assuming that llvm is next
7
+ to the swift checkout.
8
+ """
9
+
10
+ import os
11
+
12
+ REPO_BASE = os .path .abspath (os .path .join (__file__ , os .pardir , os .pardir ,
13
+ os .pardir ))
14
+ SWIFT_REPO = os .path .join (REPO_BASE , "swift" )
15
+ LLVM_REPO = os .path .join (REPO_BASE , "llvm" )
16
+ LLVM_DATAFORMATTER_PATH = os .path .join (LLVM_REPO , "utils" ,
17
+ "lldbDataFormatters.py" )
18
+
19
+
20
+ def import_llvm_dataformatters (debugger ):
21
+ if not os .access (LLVM_DATAFORMATTER_PATH , os .F_OK ):
22
+ print ("WARNING! Could not find LLVM data formatters!" )
23
+ return
24
+ cmd = 'command script import {}' .format (LLVM_DATAFORMATTER_PATH )
25
+ debugger .HandleCommand (cmd )
26
+ print ("Loaded LLVM data formatters." )
27
+
28
+
29
+ def __lldb_init_module (debugger , internal_dict ):
30
+ import_llvm_dataformatters (debugger )
You can’t perform that action at this time.
0 commit comments