mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-05 12:16:41 +02:00
cros_generate_breakpad_symbols: Output the # of errors encountered.
This is a straightforward change- the intent is to up the debug information available so we can deal w/ crashes like: http://chromegw.corp.google.com/i/chromeos/builders/x86-alex32%20canary/builds/56 BUG=None TEST=# Manual inducing of failures. Change-Id: Ibea75d1467160fc7f07c21235d701692cec96d05 Reviewed-on: https://gerrit.chromium.org/gerrit/21931 Reviewed-by: Brian Harring <ferringb@chromium.org> Tested-by: Brian Harring <ferringb@chromium.org> Commit-Ready: Brian Harring <ferringb@chromium.org>
This commit is contained in:
parent
5edf8bb308
commit
fb2cc48203
@ -27,7 +27,7 @@ DUMP_SYMS="dump_syms"
|
||||
DUMP_SYMS32="dump_syms.32"
|
||||
|
||||
CUMULATIVE_SIZE=0
|
||||
ANY_ERRORS=0
|
||||
ERROR_COUNT=0
|
||||
|
||||
SYM_FILE=$(mktemp "/tmp/sym.XXXX")
|
||||
ERR_FILE=$(mktemp "/tmp/err.XXXX")
|
||||
@ -65,7 +65,7 @@ function is_32b_elf() {
|
||||
}
|
||||
|
||||
# Dump given debug and text file. Returns 1 if any errors, even
|
||||
# if they can be ignored, but only sets ANY_ERRORS if the error should not
|
||||
# if they can be ignored, but only sets ERROR_COUNT if the error should not
|
||||
# be ignored (and we should not proceed to upload).
|
||||
function dump_file() {
|
||||
local debug_file="$1"
|
||||
@ -91,7 +91,7 @@ function dump_file() {
|
||||
fi
|
||||
error "Unable to dump symbols for ${text_file}:"
|
||||
cat "${ERR_FILE}"
|
||||
ANY_ERRORS=1
|
||||
(( ERROR_COUNT++ ))
|
||||
return 1
|
||||
else
|
||||
warn "File ${text_file} did not have debug info, using linkage symbols"
|
||||
@ -109,7 +109,7 @@ function dump_file() {
|
||||
if ! diff "${installed_sym}" "${SYM_FILE}"; then
|
||||
error "${installed_sym} differ from current sym file:"
|
||||
diff "${installed_sym}" "${SYM_FILE}"
|
||||
ANY_ERRORS=1
|
||||
(( ERROR_COUNT++ ))
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
@ -185,7 +185,7 @@ function main() {
|
||||
either_file=${either_file%\'}
|
||||
if [ ! -h "${either_file}" -a ! -f "${either_file}" ]; then
|
||||
error "Specified file ${either_file} does not exist"
|
||||
ANY_ERRORS=1
|
||||
(( ERROR_COUNT++ ))
|
||||
continue
|
||||
fi
|
||||
if [ "${either_file##*.}" == "debug" ]; then
|
||||
@ -199,8 +199,10 @@ function main() {
|
||||
|
||||
info "Generated ${CUMULATIVE_SIZE}B of debug information"
|
||||
|
||||
[ ${ANY_ERRORS} -ne 0 ] && die "Encountered problems"
|
||||
return 0
|
||||
if [[ ${ERROR_COUNT} == 0 ]]; then
|
||||
return 0
|
||||
fi
|
||||
die "Encountered ${ERROR_COUNT} problems"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user