Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Reproducers] Make clang use lldb's VFS.
In r353906 we hooked up clang and lldb's reproducer infrastructure to capture files used by clang. This patch adds the necessary logic to have clang reuse the files from lldb's reproducer during replay. Differential revision: https://reviews.llvm.org/D58309 llvm-svn: 354283
- Loading branch information
1 parent
eb3bcc1
commit 9764b65
Showing
15 changed files
with
82 additions
and
13 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 was deleted.
Oops, something went wrong.
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,3 @@ | ||
struct Bar { | ||
int success; | ||
}; |
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 @@ | ||
struct Foo {}; |
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,6 @@ | ||
breakpoint set -f main.cpp -l 5 | ||
run | ||
expr -l Objective-C++ -- @import Foo | ||
expr -l Objective-C++ -- @import Bar | ||
expr -- Bar() | ||
reproducer generate |
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,9 @@ | ||
#include "Foo.h" | ||
|
||
void stop() {} | ||
|
||
int main(int argc, char **argv) { | ||
Foo foo; | ||
stop(); // break here. | ||
return 0; | ||
} |
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,7 @@ | ||
module Foo { | ||
header "Foo.h" | ||
} | ||
|
||
module Bar { | ||
header "Bar.h" | ||
} |
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,34 @@ | ||
# Start fresh. | ||
# RUN: rm -rf %t.root | ||
# RUN: rm -rf %t.clang-cache | ||
# RUN: rm -rf %t.lldb-cache | ||
|
||
# Create a temporary root we can remove later. | ||
# RUN: mkdir -p %t.root | ||
# RUN: mkdir -p %t.clang-cache | ||
# RUN: mkdir -p %t.lldb-cache | ||
# RUN: cp %S/Inputs/main.cpp %t.root | ||
# RUN: cp %S/Inputs/Foo.h %t.root | ||
# RUN: cp %S/Inputs/Bar.h %t.root | ||
# RUN: cp %S/Inputs/module.modulemap %t.root | ||
|
||
# Compile the test case form the temporary root. | ||
# RUN: %clang %t.root/main.cpp -g -fmodules -fcxx-modules -fmodules-cache-path=%t.clang-cache -o %t.root/a.out | ||
|
||
# Capture the debug session. | ||
# RUN: %lldb -x -b -o 'settings set symbols.clang-modules-cache-path %t.lldb-cache' -s %S/Inputs/ModuleCXX.in --capture %t.repro %t.root/a.out | FileCheck %s --check-prefix CAPTURE | ||
# CAPTURE: (success = 0) | ||
|
||
# RUN: cat %t.repro/files.yaml | FileCheck %s --check-prefix YAML | ||
# YAML-DAG: Foo.h | ||
# YAML-DAG: Bar.h | ||
# YAML-DAG: module.modulemap | ||
|
||
# Remove the temporary root. | ||
# RUN: rm -rf %t.root | ||
# RUN: rm -rf %t.clang-cache | ||
# RUN: rm -rf %t.lldb-cache | ||
|
||
# Replay the debug session. | ||
# RUN: %lldb -x -b -o 'settings set symbols.clang-modules-cache-path %t.lldb-cache' -s %S/Inputs/ModuleCXX.in --replay %t.repro %t.root/a.out | FileCheck %s --check-prefix REPLAY | ||
# REPLAY: (success = 0) |
This file was deleted.
Oops, something went wrong.
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
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