Commit 82fdb915 authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[regexp-builtins-fuzzer] Print generated source in verbose mode

My standard procedure for debugging regexp builtin fuzzer finds is to
turn on verbose mode and run the repro. This extends verbose output to
include the generated script which contains e.g. the regexp pattern,
the subject string, and the actual function call.

Tbr: yangguo@chromium.org
Bug: v8:8968
Change-Id: I0c7e930f4cbd34014f2781ca280919c5b002b049
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1511276Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60120}
parent 7a6e829b
......@@ -316,7 +316,13 @@ std::string GenerateSourceString(FuzzerArgs* args, const std::string& test) {
<< "const slow = test();\n"
<< "%SetForceSlowPath(false);\n";
// clang-format on
return ss.str();
std::string source = ss.str();
if (kVerbose) {
fprintf(stderr, "Generated source:\n```\n%s\n```\n", source.c_str());
}
return source;
}
void PrintExceptionMessage(v8::Isolate* isolate, v8::TryCatch* try_catch) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment