From 77ea9b764a5084a941e4292eba63d7a3b2d039c7 Mon Sep 17 00:00:00 2001 From: Shaunak Kishore Date: Tue, 22 Jun 2021 16:34:01 -0700 Subject: [PATCH] Fix using hhvm_wrapper to start the debugger Summary: periodic1236 and others were using this script to start the debugger with no file, which I broke in D25348933 (https://github.com/facebook/hhvm/commit/92c4d6952dc7a62831b869162ba85592558cbdde). Reviewed By: periodic1236 Differential Revision: D29313903 fbshipit-source-id: 1c9f5560a63a290e57bd6bf9a1244c22e8612db2 --- hphp/tools/hhvm_wrapper.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hphp/tools/hhvm_wrapper.php b/hphp/tools/hhvm_wrapper.php index 0fd1c7dae4c..1d8976c2ccd 100755 --- a/hphp/tools/hhvm_wrapper.php +++ b/hphp/tools/hhvm_wrapper.php @@ -323,7 +323,11 @@ function do_jumpstart(string $flags, OptionMap $opts): string { $hhvm = get_hhvm_path($opts); $prof = '/tmp/jit.prof.'.posix_getpid(); $requests = $opts->get('jit-serialize'); - $cmd = "$hhvm $flags --file ".argv_for_shell() + $filename = argv_for_shell(); + if (strlen($filename) === 0) { + throw new Error('Jumpstart expects a file!'); + } + $cmd = "$hhvm $flags --file $filename" ." -v Eval.JitSerdesFile=$prof" .' -v Eval.JitSerdesMode=SerializeAndExit' .' >/dev/null 2>&1'; @@ -361,7 +365,12 @@ function run_hhvm(OptionMap $opts): void { $pfx .= 'perf record -g -o ' . $opts['perf'] . ' '; } $hhvm = get_hhvm_path($opts); - $cmd = "$pfx $hhvm $flags --file ".argv_for_shell(); + $filename = argv_for_shell(); + if (strlen($filename) === 0) { + $cmd = "$pfx $hhvm $flags"; + } else { + $cmd = "$pfx $hhvm $flags --file $filename"; + } if ($opts->containsKey('print-command')) { echo "\n$cmd\n\n"; } else { -- 2.11.4.GIT