forked from OSchip/llvm-project
Driver: Print the clang version and original command in crash scripts
When a crash report script doesn't work for a reproduction on your machine for one reason or another, it can be really tricky to figure out why not. The compiler version that crashed and the original command line before stripping flags are very helpful when this comes up. llvm-svn: 231989
This commit is contained in:
parent
7dfb92b90b
commit
42220ed3da
|
@ -551,6 +551,9 @@ void Driver::generateCompilationDiagnostics(Compilation &C,
|
|||
Diag(clang::diag::note_drv_command_failed_diag_msg)
|
||||
<< "Error generating run script: " + Script + " " + EC.message();
|
||||
} else {
|
||||
ScriptOS << "# Crash reproducer for " << getClangFullVersion() << "\n"
|
||||
<< "# Original command: ";
|
||||
Cmd.Print(ScriptOS, "\n", /*Quote=*/true);
|
||||
Cmd.Print(ScriptOS, "\n", /*Quote=*/true, &CrashInfo);
|
||||
Diag(clang::diag::note_drv_command_failed_diag_msg) << Script;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,9 @@ const int x = MODULE_MACRO;
|
|||
// CHECKSRC: @import simple;
|
||||
// CHECKSRC: const int x = 10;
|
||||
|
||||
// CHECKSH: "-cc1"
|
||||
// CHECKSH: # Crash reproducer
|
||||
// CHECKSH-NEXT: # Original command: {{.*$}}
|
||||
// CHECKSH-NEXT: "-cc1"
|
||||
// CHECKSH: "-D" "FOO=BAR"
|
||||
// CHECKSH-NOT: "-fmodules-cache-path=/tmp/"
|
||||
// CHECKSH: "crash-report-modules-{{[^ ]*}}.m"
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
// CHECK-NEXT: note: diagnostic msg: {{.*}}crash-report-{{.*}}.c
|
||||
FOO
|
||||
// CHECKSRC: FOO
|
||||
// CHECKSH: "-cc1"
|
||||
// CHECKSH: # Crash reproducer
|
||||
// CHECKSH-NEXT: # Original command: {{.*$}}
|
||||
// CHECKSH-NEXT: "-cc1"
|
||||
// CHECKSH: "-main-file-name" "crash-report.c"
|
||||
// CHECKSH: "-D" "FOO=BAR"
|
||||
// CHECKSH-NOT: "-F/tmp/"
|
||||
|
|
Loading…
Reference in New Issue