forked from swiftlang/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lldb] Fix clang importer for swift caching debugging (attempt swiftl…
…ang#2) Further improve how lldb constructing clang importer to utilize explicit modules: * Add logics to initialize the swift ASTContext from direct cc1 arguments embedded in the swiftmodule * Make sure the direct cc1 arguments are not repeated constructed. It should only be constructed as a fresh invocation * Make sure the lldb doesn't overwrite the explicit module build settings when filter arguments. This ensures the already built explicit modules are used. * Use the newly added clang option that ignore CAS info when loading PCMs. This allows lldb to load CAS enabled PCM directly from disk. rdar://135611011 (cherry picked from commit d3b9f2c)
- Loading branch information
1 parent
68db689
commit 87f13f5
Showing
3 changed files
with
64 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# REQUIRES: swift | ||
# REQUIRES: system-darwin | ||
|
||
# RUN: rm -rf %t && mkdir %t | ||
# RUN: split-file %s %t | ||
# RUN: %target-swiftc -g -Onone -save-temps \ | ||
# RUN: -module-cache-path %t/cache %t/main.swift \ | ||
# RUN: -cache-compile-job -cas-path %t/cas -explicit-module-build \ | ||
# RUN: -module-name main -o %t/main | ||
|
||
# RUN: %lldb %t/main -s %t/lldb.script 2>&1 | FileCheck %s | ||
# CHECK: LogConfiguration() -- Extra clang arguments | ||
# CHECK-COUNT-1: LogConfiguration() -- -triple | ||
# CHECK: (Int) ${{.*}} = 1 | ||
|
||
//--- main.swift | ||
func test() { | ||
print("break here") | ||
} | ||
test() | ||
|
||
//--- lldb.script | ||
# Force loading from interface to simulate no binary module available. | ||
settings set symbols.swift-module-loading-mode prefer-interface | ||
log enable lldb types | ||
b test | ||
run | ||
# Create a SwiftASTContext | ||
expr 1 | ||
quit |