aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/config.go
diff options
context:
space:
mode:
authorGeorge Burgess IV <gbiv@google.com>2020-08-05 15:03:36 -0700
committerGeorge Burgess <gbiv@chromium.org>2020-08-10 18:10:51 +0000
commit0a377f4bba0a15d994624bf078b8120ac7cdf5ce (patch)
tree21f16b65d548f802f8a19cb221ec7f48f42a2773 /compiler_wrapper/config.go
parent2953a41a804820ea859e484fd8e28aa7e9ea9de8 (diff)
downloadtoolchain-utils-0a377f4bba0a15d994624bf078b8120ac7cdf5ce.tar.gz
compiler_wrapper: dump tricium clang-tidy crash information
This CL has us dump extra info when we observe a crash while using `WITH_TIDY=tricium`. In particular: - We'll now try to generate a -E'ed source file, and stash that in a subdirectory of our general crash_diagnostics directory. - Our JSON object that represents clang-tidy output has metadata about the aforementioned crash file, if it was generated. BUG=chromium:1113442 TEST=`go test`; ran locally with a crashy clang-tidy Change-Id: I577e5ec8e990af3b7cf1d8a9fea347582d5b227b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2343974 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'compiler_wrapper/config.go')
-rw-r--r--compiler_wrapper/config.go33
1 files changed, 20 insertions, 13 deletions
diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go
index 546a0e11..e87c7baa 100644
--- a/compiler_wrapper/config.go
+++ b/compiler_wrapper/config.go
@@ -31,6 +31,8 @@ type config struct {
newWarningsDir string
// Directory to store nits in when using `WITH_TIDY=tricium`.
triciumNitsDir string
+ // Directory to store crash artifacts in.
+ crashArtifactsDir string
// Version. Only used for printing via -print-cmd.
version string
}
@@ -143,6 +145,8 @@ var crosHardenedConfig = &config{
},
newWarningsDir: "/tmp/fatal_clang_warnings",
triciumNitsDir: "/tmp/linting_output/clang-tidy",
+ // FIXME(gbiv): apply -fcrash-diagnostics-dir based on this.
+ crashArtifactsDir: "/tmp/clang_crash_diagnostics",
}
// Flags to be added to non-hardened toolchain.
@@ -173,8 +177,9 @@ var crosNonHardenedConfig = &config{
clangPostFlags: []string{
"-Wno-implicit-int-float-conversion",
},
- newWarningsDir: "/tmp/fatal_clang_warnings",
- triciumNitsDir: "/tmp/linting_output/clang-tidy",
+ newWarningsDir: "/tmp/fatal_clang_warnings",
+ triciumNitsDir: "/tmp/linting_output/clang-tidy",
+ crashArtifactsDir: "/tmp/clang_crash_diagnostics",
}
// Flags to be added to host toolchain.
@@ -211,18 +216,20 @@ var crosHostConfig = &config{
clangPostFlags: []string{
"-Wno-implicit-int-float-conversion",
},
- newWarningsDir: "/tmp/fatal_clang_warnings",
- triciumNitsDir: "/tmp/linting_output/clang-tidy",
+ newWarningsDir: "/tmp/fatal_clang_warnings",
+ triciumNitsDir: "/tmp/linting_output/clang-tidy",
+ crashArtifactsDir: "/tmp/clang_crash_diagnostics",
}
var androidConfig = &config{
- isHostWrapper: false,
- isAndroidWrapper: true,
- rootRelPath: "./",
- commonFlags: []string{},
- gccFlags: []string{},
- clangFlags: []string{},
- clangPostFlags: []string{},
- newWarningsDir: "",
- triciumNitsDir: "",
+ isHostWrapper: false,
+ isAndroidWrapper: true,
+ rootRelPath: "./",
+ commonFlags: []string{},
+ gccFlags: []string{},
+ clangFlags: []string{},
+ clangPostFlags: []string{},
+ newWarningsDir: "",
+ triciumNitsDir: "",
+ crashArtifactsDir: "",
}