| OLD | NEW | 
|---|
| 1 #!/bin/bash | 1 #!/bin/bash | 
| 2 | 2 | 
| 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS 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 # Script to generate stackdumps from a machine or dmp files. | 7 # Script to generate stackdumps from a machine or dmp files. | 
| 8 | 8 | 
| 9 # Load common constants.  This should be the first executable line. | 9 # --- BEGIN COMMON.SH BOILERPLATE --- | 
| 10 # The path to common.sh should be relative to your script's location. | 10 # Load common CrOS utilities.  Inside the chroot this file is installed in | 
|  | 11 # /usr/lib/crosutils.  Outside the chroot we find it relative to the script's | 
|  | 12 # location. | 
|  | 13 find_common_sh() { | 
|  | 14   local common_paths=(/usr/lib/crosutils $(dirname "$(readlink -f "$0")")) | 
|  | 15   local path | 
| 11 | 16 | 
| 12 . "$(dirname $0)/common.sh" | 17   SCRIPT_ROOT= | 
| 13 . "$(dirname $0)/remote_access.sh" | 18   for path in "${common_paths[@]}"; do | 
|  | 19     if [ -r "${path}/common.sh" ]; then | 
|  | 20       SCRIPT_ROOT=${path} | 
|  | 21       break | 
|  | 22     fi | 
|  | 23   done | 
|  | 24 } | 
|  | 25 | 
|  | 26 find_common_sh | 
|  | 27 . "${SCRIPT_ROOT}/common.sh" || (echo "Unable to load common.sh" && exit 1) | 
|  | 28 # --- END COMMON.SH BOILERPLATE --- | 
|  | 29 | 
|  | 30 . "${SCRIPT_ROOT}/remote_access.sh" || die "Unable to load remote_access.sh" | 
| 14 | 31 | 
| 15 assert_inside_chroot | 32 assert_inside_chroot | 
| 16 | 33 | 
| 17 MINIDUMP_DUMP=/usr/bin/minidump_dump | 34 MINIDUMP_DUMP=/usr/bin/minidump_dump | 
| 18 MINIDUMP_STACKWALK=/usr/bin/minidump_stackwalk | 35 MINIDUMP_STACKWALK=/usr/bin/minidump_stackwalk | 
| 19 USING_REMOTE=0 | 36 USING_REMOTE=0 | 
| 20 | 37 | 
| 21 get_default_board | 38 get_default_board | 
| 22 | 39 | 
| 23 DEFINE_string board "${DEFAULT_BOARD}" \ | 40 DEFINE_string board "${DEFAULT_BOARD}" \ | 
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 162       ${MINIDUMP_STACKWALK} "${dump}" "${FLAGS_breakpad_root}" 2> /dev/null | 179       ${MINIDUMP_STACKWALK} "${dump}" "${FLAGS_breakpad_root}" 2> /dev/null | 
| 163     else | 180     else | 
| 164       info "Dumping kcrash $(basename ${dump}):" | 181       info "Dumping kcrash $(basename ${dump}):" | 
| 165       cat "${dump}" | 182       cat "${dump}" | 
| 166     fi | 183     fi | 
| 167     echo "" | 184     echo "" | 
| 168   done | 185   done | 
| 169 } | 186 } | 
| 170 | 187 | 
| 171 main "$@" | 188 main "$@" | 
| OLD | NEW | 
|---|