summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--third_party/android_platform/README.chromium4
-rwxr-xr-xthird_party/android_platform/development/scripts/stack2
-rwxr-xr-xthird_party/android_platform/development/scripts/stack_core.py26
-rwxr-xr-xthird_party/android_platform/development/scripts/symbol.py42
4 files changed, 60 insertions, 14 deletions
diff --git a/third_party/android_platform/README.chromium b/third_party/android_platform/README.chromium
index de64d8b..2bf9bb22 100644
--- a/third_party/android_platform/README.chromium
+++ b/third_party/android_platform/README.chromium
@@ -2,8 +2,8 @@ Name: Android Platform engineering tools
Short Name: android platform development
URL: https://android.googlesource.com/platform/development
Version: 0
-Date: 2013/07/03
-Revision: f56a37e
+Date: 2014/05/02
+Revision: 1b10ec4
License: Apache 2.0
License File: NOT_SHIPPED
Security Critical: no
diff --git a/third_party/android_platform/development/scripts/stack b/third_party/android_platform/development/scripts/stack
index 2cd086f..e55f688 100755
--- a/third_party/android_platform/development/scripts/stack
+++ b/third_party/android_platform/development/scripts/stack
@@ -54,7 +54,7 @@ def PrintUsage():
print " argument information. Also, the 'stack data' section will be"
print " printed."
print
- print " --arch=arm|x86"
+ print " --arch=arm|arm64|x86_64|x86|mips"
print " the target architecture"
print
print " FILE should contain a stack trace in it somewhere"
diff --git a/third_party/android_platform/development/scripts/stack_core.py b/third_party/android_platform/development/scripts/stack_core.py
index 480a9eb..a11fbb4 100755
--- a/third_party/android_platform/development/scripts/stack_core.py
+++ b/third_party/android_platform/development/scripts/stack_core.py
@@ -72,9 +72,15 @@ def ConvertTrace(lines, more_info):
thread_line = re.compile("(.*)(\-\-\- ){15}\-\-\-")
dalvik_jni_thread_line = re.compile("(\".*\" prio=[0-9]+ tid=[0-9]+ NATIVE.*)")
dalvik_native_thread_line = re.compile("(\".*\" sysTid=[0-9]+ nice=[0-9]+.*)")
+
+ width = "{8}"
+ if symbol.ARCH == "arm64" or symbol.ARCH == "x86_64":
+ width = "{16}"
+
# Matches LOG(FATAL) lines, like the following example:
# [FATAL:source_file.cc(33)] Check failed: !instances_.empty()
log_fatal_line = re.compile("(\[FATAL\:.*\].*)$")
+
# Note that both trace and value line matching allow for variable amounts of
# whitespace (e.g. \t). This is because the we want to allow for the stack
# tool to operate on AndroidFeedback provided system logs. AndroidFeedback
@@ -86,20 +92,23 @@ def ConvertTrace(lines, more_info):
# Or lines from AndroidFeedback crash report system logs like:
# 03-25 00:51:05.520 I/DEBUG ( 65): #00 pc 001cf42e /data/data/com.my.project/lib/libmyproject.so
# Please note the spacing differences.
- trace_line = re.compile("(.*)\#(?P<frame>[0-9]+)[ \t]+(..)[ \t]+(0x)?(?P<address>[0-9a-f]{0,8})[ \t]+(?P<lib>[^\r\n \t]*)(?P<symbol_present> \((?P<symbol_name>.*)\))?") # pylint: disable-msg=C6310
+ trace_line = re.compile("(.*)\#(?P<frame>[0-9]+)[ \t]+(..)[ \t]+(0x)?(?P<address>[0-9a-f]{0,16})[ \t]+(?P<lib>[^\r\n \t]*)(?P<symbol_present> \((?P<symbol_name>.*)\))?") # pylint: disable-msg=C6310
+
# Matches lines emitted by src/base/debug/stack_trace_android.cc, like:
# #00 0x7324d92d /data/app-lib/org.chromium.native_test-1/libbase.cr.so+0x0006992d
# This pattern includes the unused named capture groups <symbol_present> and
# <symbol_name> so that it can interoperate with the |trace_line| regex.
- debug_trace_line = re.compile('(.*)(?P<frame>\#[0-9]+ 0x[0-9a-f]{8,8}) '
- '(?P<lib>[^+]+)\+0x(?P<address>[0-9a-f]{8,8})'
- '(?P<symbol_present>)(?P<symbol_name>)')
+ debug_trace_line = re.compile(
+ '(.*)(?P<frame>\#[0-9]+ 0x[0-9a-f]' + width + ') '
+ '(?P<lib>[^+]+)\+0x(?P<address>[0-9a-f]' + width + ')'
+ '(?P<symbol_present>)(?P<symbol_name>)')
+
# Examples of matched value lines include:
# bea4170c 8018e4e9 /data/data/com.my.project/lib/libmyproject.so
# bea4170c 8018e4e9 /data/data/com.my.project/lib/libmyproject.so (symbol)
# 03-25 00:51:05.530 I/DEBUG ( 65): bea4170c 8018e4e9 /data/data/com.my.project/lib/libmyproject.so
# Again, note the spacing differences.
- value_line = re.compile("(.*)([0-9a-f]{8})[ \t]+([0-9a-f]{8})[ \t]+([^\r\n \t]*)( \((.*)\))?")
+ value_line = re.compile("(.*)([0-9a-f]" + width + ")[ \t]+([0-9a-f]" + width + ")[ \t]+([^\r\n \t]*)( \((.*)\))?")
# Lines from 'code around' sections of the output will be matched before
# value lines because otheriwse the 'code around' sections will be confused as
# value lines.
@@ -107,7 +116,12 @@ def ConvertTrace(lines, more_info):
# Examples include:
# 801cf40c ffffc4cc 00b2f2c5 00b2f1c7 00c1e1a8
# 03-25 00:51:05.530 I/DEBUG ( 65): 801cf40c ffffc4cc 00b2f2c5 00b2f1c7 00c1e1a8
- code_line = re.compile("(.*)[ \t]*[a-f0-9]{8}[ \t]*[a-f0-9]{8}[ \t]*[a-f0-9]{8}[ \t]*[a-f0-9]{8}[ \t]*[a-f0-9]{8}[ \t]*[ \r\n]") # pylint: disable-msg=C6310
+ code_line = re.compile("(.*)[ \t]*[a-f0-9]" + width +
+ "[ \t]*[a-f0-9]" + width +
+ "[ \t]*[a-f0-9]" + width +
+ "[ \t]*[a-f0-9]" + width +
+ "[ \t]*[a-f0-9]" + width +
+ "[ \t]*[ \r\n]") # pylint: disable-msg=C6310
trace_lines = []
value_lines = []
diff --git a/third_party/android_platform/development/scripts/symbol.py b/third_party/android_platform/development/scripts/symbol.py
index 9eb24849..d1fbaf7 100755
--- a/third_party/android_platform/development/scripts/symbol.py
+++ b/third_party/android_platform/development/scripts/symbol.py
@@ -52,13 +52,29 @@ def ToolPath(tool, toolchain_info=None):
if ARCH == "arm":
toolchain_source = "arm-linux-androideabi-4.6"
toolchain_prefix = "arm-linux-androideabi"
- else:
+ ndk = "ndk"
+ elif ARCH == "arm64":
+ toolchain_source = "aarch64-linux-android-4.8"
+ toolchain_prefix = "aarch64-linux-android"
+ ndk = "ndk_experimental"
+ elif ARCH == "x86":
toolchain_source = "x86-4.6"
toolchain_prefix = "i686-android-linux"
+ ndk = "ndk"
+ elif ARCH == "x86_64":
+ toolchain_source = "x86_64-4.8"
+ toolchain_prefix = "x86_64-linux-android"
+ ndk = "ndk_experimental"
+ elif ARCH == "mips":
+ toolchain_source = "mipsel-linux-android-4.6"
+ toolchain_prefix = "mipsel-linux-android"
+ ndk = "ndk"
+ else:
+ raise Exception("Could not find tool chain")
toolchain_subdir = (
- "third_party/android_tools/ndk/toolchains/%s/prebuilt/linux-x86_64/bin" %
- toolchain_source)
+ "third_party/android_tools/%s/toolchains/%s/prebuilt/linux-x86_64/bin" %
+ (ndk, toolchain_source))
return os.path.join(CHROME_SRC,
toolchain_subdir,
@@ -78,14 +94,29 @@ def FindToolchain():
return TOOLCHAIN_INFO
## Known toolchains, newer ones in the front.
- if ARCH == "arm":
+ if ARCH == "arm64":
+ gcc_version = "4.8"
+ known_toolchains = [
+ ("aarch64-linux-android-" + gcc_version, "aarch64", "aarch64-linux-android")
+ ]
+ elif ARCH == "arm":
+ gcc_version = "4.6"
known_toolchains = [
- ("arm-linux-androideabi-4.6", "arm", "arm-linux-androideabi"),
+ ("arm-linux-androideabi-" + gcc_version, "arm", "arm-linux-androideabi"),
]
elif ARCH =="x86":
known_toolchains = [
("i686-android-linux-4.4.3", "x86", "i686-android-linux")
]
+ elif ARCH =="x86_64":
+ known_toolchains = [
+ ("x86_64-linux-android-4.8", "x86_64", "x86_64-linux-android")
+ ]
+ elif ARCH == "mips":
+ gcc_version = "4.6"
+ known_toolchains = [
+ ("mipsel-linux-android-" + gcc_version, "mips", "mipsel-linux-android")
+ ]
else:
known_toolchains = []
@@ -94,6 +125,7 @@ def FindToolchain():
toolchain_info = (label, platform, target);
if os.path.exists(ToolPath("addr2line", toolchain_info)):
TOOLCHAIN_INFO = toolchain_info
+ print "Using toolchain from :" + ToolPath("", TOOLCHAIN_INFO)
return toolchain_info
raise Exception("Could not find tool chain")