Index: lib/sanitizer_common/sanitizer_coverage_libcdep.cc =================================================================== --- lib/sanitizer_common/sanitizer_coverage_libcdep.cc +++ lib/sanitizer_common/sanitizer_coverage_libcdep.cc @@ -787,7 +787,6 @@ 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 @@ 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 @@ InternalMmapVector offsets(0); InternalScopedString path(kMaxPathLength); - InternalMmapVector sancov_argv(module_name_vec.size() + 2); + InternalMmapVector 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 @@ 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); } Index: test/asan/TestCases/Linux/coverage_html_report.cc =================================================================== --- test/asan/TestCases/Linux/coverage_html_report.cc +++ test/asan/TestCases/Linux/coverage_html_report.cc @@ -20,5 +20,5 @@ // CHECK-main: PID: [[PID:[0-9]+]] // CHECK-main: [[PID]].sancov: 2 PCs written -// CHECK-main: html report generated to ./coverage_html_report.cc.tmp.[[PID]].html +// CHECK-main: coverage report generated to ./coverage_html_report.cc.tmp.[[PID]].html // CHECK-ls: coverage_html_report.cc.tmp.{{[0-9]+}}.html