aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/devenv_commands.py
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2018-08-02 17:01:28 -0400
committerJosh Matthews <josh@joshmatthews.net>2018-08-08 15:34:40 -0400
commitef6620543626c371684a99ded5e0a928ea654ed3 (patch)
treecbd7cea3c87102c53849e9ffe3bd1553b9bb13b9 /python/servo/devenv_commands.py
parent2ceb8dcd22f13763504081d4cbde2ea89f6f4a89 (diff)
downloadservo-ef6620543626c371684a99ded5e0a928ea654ed3.tar.gz
servo-ef6620543626c371684a99ded5e0a928ea654ed3.zip
mach: Add ndk-stack command for android crash logs.
Diffstat (limited to 'python/servo/devenv_commands.py')
-rw-r--r--python/servo/devenv_commands.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py
index c6a3f8527ba..ff961df9033 100644
--- a/python/servo/devenv_commands.py
+++ b/python/servo/devenv_commands.py
@@ -14,6 +14,7 @@ from time import time
import sys
import urllib2
import json
+import subprocess
from mach.decorators import (
CommandArgument,
@@ -227,3 +228,26 @@ class MachCommands(CommandBase):
with cd(self.context.topdir):
return self.call_rustup_run(["cargo", "fetch"], env=self.build_env())
+
+ @Command('ndk-stack',
+ description='Invoke the ndk-stack tool with the expected symbol paths',
+ category='devenv')
+ @CommandArgument('--release', action='store_true', help="Use release build symbols")
+ @CommandArgument('--target', action='store', default="armv7-linux-androideabi",
+ help="Build target")
+ @CommandArgument('logfile', action='store', help="Path to logcat output with crash report")
+ def stack(self, release, target, logfile):
+ if not path.isfile(logfile):
+ print(logfile + " doesn't exist")
+ return -1
+ env = self.build_env(target=target)
+ ndk_stack = path.join(env["ANDROID_NDK"], "ndk-stack")
+ sym_path = path.join(
+ "target",
+ target,
+ "release" if release else "debug",
+ "apk",
+ "obj",
+ "local",
+ "armeabi-v7a")
+ print(subprocess.check_output([ndk_stack, "-sym", sym_path, "-dump", logfile]))