2
2
3
3
.. highlight :: none
4
4
5
- ============================
5
+ .. contents ::
6
+
6
7
Debugging the Swift Compiler
7
8
============================
8
9
9
- .. contents ::
10
-
11
10
Abstract
12
11
--------
13
12
@@ -440,14 +439,14 @@ For more information and a high level example, see:
440
439
441
440
442
441
Debugging Swift Executables
443
- ---------------------------
442
+ ===========================
444
443
445
444
One can use the previous tips for debugging the Swift compiler with Swift
446
445
executables as well. Here are some additional useful techniques that one can use
447
446
in Swift executables.
448
447
449
448
Determining the mangled name of a function in LLDB
450
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
449
+ --------------------------------------------------
451
450
452
451
One problem that often comes up when debugging Swift code in LLDB is that LLDB
453
452
shows the demangled name instead of the mangled name. This can lead to mistakes
@@ -461,8 +460,8 @@ function in the current frame::
461
460
Module: file = "/Volumes/Files/work/solon/build/build-swift/validation-test-macosx-x86_64/stdlib/Output/CollectionType.swift.gyb.tmp/CollectionType3", arch = "x86_64"
462
461
Symbol: id = {0x0000008c}, range = [0x0000000100004db0-0x00000001000056f0), name="ext.CollectionType3.CollectionType3.MutableCollectionType2<A where A: CollectionType3.MutableCollectionType2>.(subscript.materializeForSet : (Swift.Range<A.Index>) -> Swift.MutableSlice<A>).(closure #1)", mangled="_TFFeRq_15CollectionType322MutableCollectionType2_S_S0_m9subscriptFGVs5Rangeqq_s16MutableIndexable5Index_GVs12MutableSliceq__U_FTBpRBBRQPS0_MS4__T_"
463
462
464
- Debugging failures in LLDB
465
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
463
+ Debugging LLDB failures
464
+ =======================
466
465
467
466
Sometimes one needs to be able to while debugging actually debug LLDB and its
468
467
interaction with Swift itself. Some examples of problems where this can come up
@@ -483,7 +482,7 @@ For more details about any of the information below, please run::
483
482
(lldb) help log enable
484
483
485
484
"Types" Log
486
- ```````````
485
+ -----------
487
486
488
487
The "types" log reports on LLDB's process of constructing SwiftASTContexts and
489
488
errors that may occur. The two main tasks here are:
@@ -514,7 +513,7 @@ This will ensure that the type import command is run before /any/ modules are
514
513
imported.
515
514
516
515
"Expression" Log
517
- ````````````````
516
+ ----------------
518
517
519
518
The "expression" log reports on the process of wrapping, parsing, SILGen'ing,
520
519
JITing, and inserting an expression into the current Swift module. Since this can
@@ -542,7 +541,7 @@ such a situation, run all expressions before the bad expression, turn on the
542
541
logging, and only then run the bad expression.
543
542
544
543
Multiple Logs at a Time
545
- ```````````````````````
544
+ -----------------------
546
545
547
546
Note, you can also turn on more than one log at a time as well, e.x.::
548
547
0 commit comments