summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common
diff options
context:
space:
mode:
authorMike Aizatsky <aizatsky@chromium.org>2016-02-12 00:29:24 +0000
committerMike Aizatsky <aizatsky@chromium.org>2016-02-12 00:29:24 +0000
commit2c67334e19a832e5b4d736b5d0637659aa7b2f10 (patch)
tree59719ffff9b297f7e008c525847efb57e290ce3e /lib/sanitizer_common
parentdecaf09efeea9cf06d1dea2abd730922c3775162 (diff)
[sancov] improved object files handling.
Updating sancov invocation on html_cov_dump. sancov change: http://reviews.llvm.org/D17169 Differential Revision: http://reviews.llvm.org/D17171 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@260629 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common')
-rw-r--r--lib/sanitizer_common/sanitizer_coverage_libcdep.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/sanitizer_common/sanitizer_coverage_libcdep.cc b/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
index 2f4f02f0d..64c2229f6 100644
--- a/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
+++ b/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
@@ -787,7 +787,6 @@ static void GenerateHtmlReport(const InternalMmapVector<char *> &sancov_argv) {
if (!common_flags()->html_cov_report || sancov_argv[0] == nullptr) {
return;
}
-
InternalScopedString report_path(kMaxPathLength);
fd_t report_fd =
CovOpenFile(&report_path, false /* packed */, GetProcessName(), "html");
@@ -795,10 +794,8 @@ static void GenerateHtmlReport(const InternalMmapVector<char *> &sancov_argv) {
kInvalidFd /* stdin */, report_fd /* std_out */);
if (pid > 0) {
int result = WaitForProcess(pid);
- if (result == 0) {
- VReport(1, " CovDump: html report generated to %s (%d)\n",
- report_path.data(), result);
- }
+ if (result == 0)
+ Printf("coverage report generated to %s\n", report_path.data());
}
}
@@ -809,12 +806,8 @@ void CoverageData::DumpOffsets() {
InternalMmapVector<uptr> offsets(0);
InternalScopedString path(kMaxPathLength);
- InternalMmapVector<char *> sancov_argv(module_name_vec.size() + 2);
+ InternalMmapVector<char *> sancov_argv(module_name_vec.size() * 2 + 3);
sancov_argv.push_back(FindPathToBinary(common_flags()->sancov_path));
- if (GetArgv() != nullptr) {
- sancov_argv.push_back(internal_strdup("-obj"));
- sancov_argv.push_back(internal_strdup(GetArgv()[0]));
- }
sancov_argv.push_back(internal_strdup("-html-report"));
auto argv_deleter = at_scope_exit([&] {
for (uptr i = 0; i < sancov_argv.size(); ++i) {
@@ -846,6 +839,7 @@ void CoverageData::DumpOffsets() {
if (fd == kInvalidFd) continue;
WriteToFile(fd, offsets.data(), offsets.size() * sizeof(offsets[0]));
CloseFile(fd);
+ sancov_argv.push_back(internal_strdup(r.copied_module_name));
sancov_argv.push_back(internal_strdup(path.data()));
VReport(1, " CovDump: %s: %zd PCs written\n", path.data(), num_offsets);
}