Commit 46fa7a44 authored by maniscalco's avatar maniscalco Committed by Commit bot

Revert of Make it easier to debug failed symbolization (patchset #4 id:130001...

Revert of Make it easier to debug failed symbolization (patchset #4 id:130001 of https://codereview.chromium.org/646683002/)

Reason for revert:
"Android Tests" bot is failing in "run stack tool with logcat dump" step.

http://build.chromium.org/p/chromium.linux/builders/Android%20Tests

Suspecting this patch.  Reverting.

@@@BUILD_STEP Run stack tool with logcat dump@@@
> /b/build/slave/Android_Tests/build/src/third_party/android_platform/development/scripts/stack --more-info /b/build/slave/Android_Tests/build/src/out/Release/full_log.txt
/b/build/slave/Android_Tests/build/src/third_party/android_platform/development/scripts/../../../../third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-addr2line: /b/build/slave/Android_Tests/build/src/third_party/android_platform/development/scripts/../../../../out/Release/icudtl.dat: File format not recognized

See bug https://code.google.com/p/chromium/issues/detail?id=422090

Original issue's description:
> Make it easier to debug failed symbolization
>
> This just adds a --verbose argument and some debug logging sprinkled in
> useful places.
>
> Adds '.' as a candidate directory for libraries (gn puts shared
> libraries at the root build directory).
>
> Committed: https://crrev.com/17ffc51dfc9bd6dfe0d38ce8f6f8313544ea25af
> Cr-Commit-Position: refs/heads/master@{#298952}

TBR=rmcilroy@chromium.org,cjhopman@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/642843003

Cr-Commit-Position: refs/heads/master@{#299002}
parent ef5eefe3
...@@ -15,14 +15,8 @@ glue layer against. ...@@ -15,14 +15,8 @@ glue layer against.
Local Modifications: Local Modifications:
Only picked the few scripts needed by chrome. Only picked the few scripts needed by chrome.
The scripts have been modified to better suit Chromium development. Changes
include, but are not limited to, the following:
Added memoization of addr2line and objdump.
Added option to change the amount of symbolization done.
Updated output directories to use environment variable. Updated output directories to use environment variable.
When calling addr2line, check the symbol is a file (and not a directory). When calling addr2line, check the symbol is a file (and not a directory).
Added support for parsing LOG(FATAL) and DCHECK errors and their Added support for parsing LOG(FATAL) and DCHECK errors and their
stack traces, as emitted by src/base/debug/stack_trace_android.cc stack traces, as emitted by src/base/debug/stack_trace_android.cc
Added support for finding symbols when library is loaded directly from the APK. Added support for finding symbols when library is loaded directly from the APK.
Added debug logging and --verbose parameter.
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
import getopt import getopt
import glob import glob
import logging
import os import os
import sys import sys
...@@ -58,9 +57,6 @@ def PrintUsage(): ...@@ -58,9 +57,6 @@ def PrintUsage():
print " --arch=arm|arm64|x86_64|x86|mips" print " --arch=arm|arm64|x86_64|x86|mips"
print " the target architecture" print " the target architecture"
print print
print " --verbose"
print " enable extra logging, particularly for debugging failed symbolization"
print
print " FILE should contain a stack trace in it somewhere" print " FILE should contain a stack trace in it somewhere"
print " the tool will find that and re-print it with" print " the tool will find that and re-print it with"
print " source files and line numbers. If you don't" print " source files and line numbers. If you don't"
...@@ -112,16 +108,15 @@ def UnzipSymbols(symbolfile, symdir=None): ...@@ -112,16 +108,15 @@ def UnzipSymbols(symbolfile, symdir=None):
return (symdir, symdir) return (symdir, symdir)
def main(argv): def main():
try: try:
options, arguments = getopt.getopt(argv, "", options, arguments = getopt.getopt(sys.argv[1:], "",
["more-info", ["more-info",
"less-info", "less-info",
"chrome-symbols-dir=", "chrome-symbols-dir=",
"symbols-dir=", "symbols-dir=",
"symbols-zip=", "symbols-zip=",
"arch=", "arch=",
"verbose",
"help"]) "help"])
except getopt.GetoptError, unused_error: except getopt.GetoptError, unused_error:
PrintUsage() PrintUsage()
...@@ -143,8 +138,6 @@ def main(argv): ...@@ -143,8 +138,6 @@ def main(argv):
more_info = True more_info = True
elif option == "--less-info": elif option == "--less-info":
more_info = False more_info = False
elif option == "--verbose":
logging.basicConfig(level=logging.DEBUG)
if len(arguments) > 1: if len(arguments) > 1:
PrintUsage() PrintUsage()
...@@ -174,6 +167,6 @@ def main(argv): ...@@ -174,6 +167,6 @@ def main(argv):
os.system(cmd) os.system(cmd)
if __name__ == "__main__": if __name__ == "__main__":
sys.exit(main(sys.argv[1:])) main()
# vi: ts=2 sw=2 # vi: ts=2 sw=2
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
"""stack symbolizes native crash dumps.""" """stack symbolizes native crash dumps."""
import logging
import re import re
import symbol import symbol
...@@ -193,7 +192,6 @@ def ConvertTrace(lines, more_info): ...@@ -193,7 +192,6 @@ def ConvertTrace(lines, more_info):
if match: if match:
frame, code_addr, area, symbol_present, symbol_name = match.group( frame, code_addr, area, symbol_present, symbol_name = match.group(
'frame', 'address', 'lib', 'symbol_present', 'symbol_name') 'frame', 'address', 'lib', 'symbol_present', 'symbol_name')
logging.debug('Found trace line: %s' % line.strip())
if frame <= last_frame and (trace_lines or value_lines): if frame <= last_frame and (trace_lines or value_lines):
PrintOutput(trace_lines, value_lines, more_info) PrintOutput(trace_lines, value_lines, more_info)
...@@ -205,11 +203,9 @@ def ConvertTrace(lines, more_info): ...@@ -205,11 +203,9 @@ def ConvertTrace(lines, more_info):
if area == UNKNOWN or area == HEAP or area == STACK: if area == UNKNOWN or area == HEAP or area == STACK:
trace_lines.append((code_addr, "", area)) trace_lines.append((code_addr, "", area))
else: else:
logging.debug('Identified lib: %s' % area)
# If a calls b which further calls c and c is inlined to b, we want to # If a calls b which further calls c and c is inlined to b, we want to
# display "a -> b -> c" in the stack trace instead of just "a -> c" # display "a -> b -> c" in the stack trace instead of just "a -> c"
info = symbol.SymbolInformation(area, code_addr, more_info) info = symbol.SymbolInformation(area, code_addr, more_info)
logging.debug('symbol information: %s' % info)
nest_count = len(info) - 1 nest_count = len(info) - 1
for (source_symbol, source_location, object_symbol_with_offset) in info: for (source_symbol, source_location, object_symbol_with_offset) in info:
if not source_symbol: if not source_symbol:
......
...@@ -21,7 +21,6 @@ The information can include symbol names, offsets, and source locations. ...@@ -21,7 +21,6 @@ The information can include symbol names, offsets, and source locations.
import glob import glob
import itertools import itertools
import logging
import os import os
import re import re
import subprocess import subprocess
...@@ -209,7 +208,6 @@ def GetCandidates(dirs, filepart, candidate_fun): ...@@ -209,7 +208,6 @@ def GetCandidates(dirs, filepart, candidate_fun):
candidates = PathListJoin([out_dir], buildtype_list) + [CHROME_SYMBOLS_DIR] candidates = PathListJoin([out_dir], buildtype_list) + [CHROME_SYMBOLS_DIR]
candidates = PathListJoin(candidates, dirs) candidates = PathListJoin(candidates, dirs)
candidates = PathListJoin(candidates, [filepart]) candidates = PathListJoin(candidates, [filepart])
logging.debug('GetCandidates: prefiltered candidates = %s' % candidates)
candidates = list( candidates = list(
itertools.chain.from_iterable(map(candidate_fun, candidates))) itertools.chain.from_iterable(map(candidate_fun, candidates)))
candidates = sorted(candidates, key=os.path.getmtime, reverse=True) candidates = sorted(candidates, key=os.path.getmtime, reverse=True)
...@@ -284,7 +282,7 @@ def GetCandidateLibraries(library_name): ...@@ -284,7 +282,7 @@ def GetCandidateLibraries(library_name):
A list of matching library filenames for library_name. A list of matching library filenames for library_name.
""" """
return GetCandidates( return GetCandidates(
['lib', 'lib.target', '.'], library_name, ['lib', 'lib.target'], library_name,
lambda filename: filter(os.path.exists, [filename])) lambda filename: filter(os.path.exists, [filename]))
def TranslateLibPath(lib): def TranslateLibPath(lib):
...@@ -308,15 +306,11 @@ def TranslateLibPath(lib): ...@@ -308,15 +306,11 @@ def TranslateLibPath(lib):
if mapping: if mapping:
library_name = mapping library_name = mapping
logging.debug('TranslateLibPath: lib=%s library_name=%s' % (lib, library_name))
candidate_libraries = GetCandidateLibraries(library_name) candidate_libraries = GetCandidateLibraries(library_name)
logging.debug('TranslateLibPath: candidate_libraries=%s' % candidate_libraries)
if not candidate_libraries: if not candidate_libraries:
return lib return lib
library_path = os.path.relpath(candidate_libraries[0], SYMBOLS_DIR) library_path = os.path.relpath(candidate_libraries[0], SYMBOLS_DIR)
logging.debug('TranslateLibPath: library_path=%s' % library_path)
return '/' + library_path return '/' + library_path
def SymbolInformation(lib, addr, get_detailed_info): def SymbolInformation(lib, addr, get_detailed_info):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment