[PATCH] D17171: [sancov] correct object files handling.
Mike Aizatsky via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 11 16:33:47 PST 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL260629: [sancov] improved object files handling. (authored by aizatsky).
Changed prior to commit:
http://reviews.llvm.org/D17171?vs=47732&id=47750#toc
Repository:
rL LLVM
http://reviews.llvm.org/D17171
Files:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
compiler-rt/trunk/test/asan/TestCases/Linux/coverage_html_report.cc
Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
@@ -787,18 +787,15 @@
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");
int pid = StartSubprocess(sancov_argv[0], sancov_argv.data(),
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<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 @@
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: compiler-rt/trunk/test/asan/TestCases/Linux/coverage_html_report.cc
===================================================================
--- compiler-rt/trunk/test/asan/TestCases/Linux/coverage_html_report.cc
+++ compiler-rt/trunk/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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17171.47750.patch
Type: text/x-patch
Size: 2627 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160212/b5377ccd/attachment.bin>
More information about the llvm-commits
mailing list