| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # This is a small script for manually launching valgrind, along with passing | 7 # This is a small script for manually launching valgrind, along with passing |
| 8 # it the suppression file, and some helpful arguments (automatically attaching | 8 # it the suppression file, and some helpful arguments (automatically attaching |
| 9 # the debugger on failures, etc). Run it from your repo root, something like: | 9 # the debugger on failures, etc). Run it from your repo root, something like: |
| 10 # $ sh ./tools/valgrind/valgrind.sh ./out/Debug/chrome | 10 # $ sh ./tools/valgrind/valgrind.sh ./out/Debug/chrome |
| 11 # | 11 # |
| 12 # This is mostly intended for running the chrome browser interactively. | 12 # This is mostly intended for running the chrome browser interactively. |
| 13 # To run unit tests, you probably want to run chrome_tests.sh instead. | 13 # To run unit tests, you probably want to run chrome_tests.sh instead. |
| 14 # That's the script used by the valgrind buildbot. | 14 # That's the script used by the valgrind buildbot. |
| 15 | 15 |
| 16 export THISDIR=`dirname $0` | 16 export THISDIR=`dirname $0` |
| 17 | 17 |
| 18 setup_memcheck() { | 18 setup_memcheck() { |
| 19 RUN_COMMAND="valgrind" | 19 RUN_COMMAND="valgrind" |
| 20 # Prefer a 32-bit gdb if it's available. | 20 # Prefer a 32-bit gdb if it's available. |
| 21 GDB="/usr/bin/gdb32"; | 21 GDB="/usr/bin/gdb32"; |
| 22 if [ ! -x $GDB ]; then | 22 if [ ! -x $GDB ]; then |
| 23 GDB="gdb" | 23 GDB="gdb" |
| 24 fi | 24 fi |
| 25 | 25 |
| 26 # Prompt to attach gdb when there was an error detected. | 26 # Prompt to attach gdb when there was an error detected. |
| 27 DEFAULT_TOOL_FLAGS=("--db-command=$GDB -nw %f %p" "--db-attach=yes" \ | 27 DEFAULT_TOOL_FLAGS=("--db-command=$GDB -nw %f %p" "--db-attach=yes" \ |
| 28 # Keep the registers in gdb in sync with the code. |
| 29 "--vex-iropt-precise-memory-exns=yes" \ |
| 28 # Overwrite newly allocated or freed objects | 30 # Overwrite newly allocated or freed objects |
| 29 # with 0x41 to catch inproper use. | 31 # with 0x41 to catch inproper use. |
| 30 "--malloc-fill=41" "--free-fill=41" \ | 32 "--malloc-fill=41" "--free-fill=41" \ |
| 31 # Increase the size of stacks being tracked. | 33 # Increase the size of stacks being tracked. |
| 32 "--num-callers=30") | 34 "--num-callers=30") |
| 33 } | 35 } |
| 34 | 36 |
| 35 setup_tsan() { | 37 setup_tsan() { |
| 36 RUN_COMMAND="valgrind-tsan.sh" | 38 RUN_COMMAND="valgrind-tsan.sh" |
| 37 IGNORE_FILE="$THISDIR/tsan/ignores.txt" | 39 IGNORE_FILE="$THISDIR/tsan/ignores.txt" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 G_SLICE=always-malloc \ | 109 G_SLICE=always-malloc \ |
| 108 NSS_DISABLE_UNLOAD=1 \ | 110 NSS_DISABLE_UNLOAD=1 \ |
| 109 NSS_DISABLE_ARENA_FREE_LIST=1 \ | 111 NSS_DISABLE_ARENA_FREE_LIST=1 \ |
| 110 G_DEBUG=fatal_warnings \ | 112 G_DEBUG=fatal_warnings \ |
| 111 GTEST_DEATH_TEST_USE_FORK=1 \ | 113 GTEST_DEATH_TEST_USE_FORK=1 \ |
| 112 $RUN_COMMAND \ | 114 $RUN_COMMAND \ |
| 113 --trace-children=yes \ | 115 --trace-children=yes \ |
| 114 --suppressions="$SUPPRESSIONS" \ | 116 --suppressions="$SUPPRESSIONS" \ |
| 115 "${DEFAULT_TOOL_FLAGS[@]}" \ | 117 "${DEFAULT_TOOL_FLAGS[@]}" \ |
| 116 "$@" | 118 "$@" |
| OLD | NEW |