parse-processor 913 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/sh
  2. # find the name of the log file to process, it must not start with a dash.
  3. log_file="v8.log"
  4. for arg in "$@"
  5. do
  6. if ! expr "X${arg}" : "^X-" > /dev/null; then
  7. log_file=${arg}
  8. fi
  9. done
  10. tools_path=`cd $(dirname "$0");pwd`
  11. if [ ! "$D8_PATH" ]; then
  12. d8_public=`which d8`
  13. if [ -x "$d8_public" ]; then D8_PATH=$(dirname "$d8_public"); fi
  14. fi
  15. [ -n "$D8_PATH" ] || D8_PATH=$tools_path/..
  16. d8_exec=$D8_PATH/d8
  17. if [ ! -x "$d8_exec" ]; then
  18. D8_PATH=`pwd`/out.gn/optdebug
  19. d8_exec=$D8_PATH/d8
  20. fi
  21. if [ ! -x "$d8_exec" ]; then
  22. d8_exec=`grep -m 1 -o '".*/d8"' $log_file | sed 's/"//g'`
  23. fi
  24. if [ ! -x "$d8_exec" ]; then
  25. echo "d8 shell not found in $D8_PATH"
  26. echo "Please provide path to d8 as env var in D8_PATH"
  27. exit 1
  28. fi
  29. # nm spits out 'no symbols found' messages to stderr.
  30. cat $log_file | $d8_exec --allow-natives-syntax \
  31. --module $tools_path/parse-processor-driver.mjs -- $@ 2>/dev/null