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.
Local Modifications:
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.
When calling addr2line, check the symbol is a file (and not a directory).
Added support for parsing LOG(FATAL) and DCHECK errors and their
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 debug logging and --verbose parameter.
......@@ -18,7 +18,6 @@
import getopt
import glob
import logging
import os
import sys
......@@ -58,9 +57,6 @@ def PrintUsage():
print " --arch=arm|arm64|x86_64|x86|mips"
print " the target architecture"
print
print " --verbose"
print " enable extra logging, particularly for debugging failed symbolization"
print
print " FILE should contain a stack trace in it somewhere"
print " the tool will find that and re-print it with"
print " source files and line numbers. If you don't"
......@@ -112,16 +108,15 @@ def UnzipSymbols(symbolfile, symdir=None):
return (symdir, symdir)
def main(argv):
def main():
try:
options, arguments = getopt.getopt(argv, "",
options, arguments = getopt.getopt(sys.argv[1:], "",
["more-info",
"less-info",
"chrome-symbols-dir=",
"symbols-dir=",
"symbols-zip=",
"arch=",
"verbose",
"help"])
except getopt.GetoptError, unused_error:
PrintUsage()
......@@ -143,8 +138,6 @@ def main(argv):
more_info = True
elif option == "--less-info":
more_info = False
elif option == "--verbose":
logging.basicConfig(level=logging.DEBUG)
if len(arguments) > 1:
PrintUsage()
......@@ -174,6 +167,6 @@ def main(argv):
os.system(cmd)
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))
main()
# vi: ts=2 sw=2
......@@ -16,7 +16,6 @@
"""stack symbolizes native crash dumps."""
import logging
import re
import symbol
......@@ -193,7 +192,6 @@ def ConvertTrace(lines, more_info):
if match:
frame, code_addr, area, symbol_present, symbol_name = match.group(
'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):
PrintOutput(trace_lines, value_lines, more_info)
......@@ -205,11 +203,9 @@ def ConvertTrace(lines, more_info):
if area == UNKNOWN or area == HEAP or area == STACK:
trace_lines.append((code_addr, "", area))
else:
logging.debug('Identified lib: %s' % area)
# 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"
info = symbol.SymbolInformation(area, code_addr, more_info)
logging.debug('symbol information: %s' % info)
nest_count = len(info) - 1
for (source_symbol, source_location, object_symbol_with_offset) in info:
if not source_symbol:
......
......@@ -21,7 +21,6 @@ The information can include symbol names, offsets, and source locations.
import glob
import itertools
import logging
import os
import re
import subprocess
......@@ -209,7 +208,6 @@ def GetCandidates(dirs, filepart, candidate_fun):
candidates = PathListJoin([out_dir], buildtype_list) + [CHROME_SYMBOLS_DIR]
candidates = PathListJoin(candidates, dirs)
candidates = PathListJoin(candidates, [filepart])
logging.debug('GetCandidates: prefiltered candidates = %s' % candidates)
candidates = list(
itertools.chain.from_iterable(map(candidate_fun, candidates)))
candidates = sorted(candidates, key=os.path.getmtime, reverse=True)
......@@ -284,7 +282,7 @@ def GetCandidateLibraries(library_name):
A list of matching library filenames for library_name.
"""
return GetCandidates(
['lib', 'lib.target', '.'], library_name,
['lib', 'lib.target'], library_name,
lambda filename: filter(os.path.exists, [filename]))
def TranslateLibPath(lib):
......@@ -308,15 +306,11 @@ def TranslateLibPath(lib):
if mapping:
library_name = mapping
logging.debug('TranslateLibPath: lib=%s library_name=%s' % (lib, library_name))
candidate_libraries = GetCandidateLibraries(library_name)
logging.debug('TranslateLibPath: candidate_libraries=%s' % candidate_libraries)
if not candidate_libraries:
return lib
library_path = os.path.relpath(candidate_libraries[0], SYMBOLS_DIR)
logging.debug('TranslateLibPath: library_path=%s' % library_path)
return '/' + library_path
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