Skip to content

Commit

Permalink
mach: Add ndk-stack command for android crash logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdm committed Aug 8, 2018
1 parent 2ceb8dc commit ef66205
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions python/servo/devenv_commands.py
Expand Up @@ -14,6 +14,7 @@
import sys
import urllib2
import json
import subprocess

from mach.decorators import (
CommandArgument,
Expand Down Expand Up @@ -227,3 +228,26 @@ def fetch(self):

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]))

0 comments on commit ef66205

Please sign in to comment.