Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1023)

Unified Diff: sky/tools/skydb

Issue 787803006: Fix tools/android_stack_parser/stack and use it in skydb (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/android_stack_parser/stack » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tools/skydb
diff --git a/sky/tools/skydb b/sky/tools/skydb
index 02c92412bb7335cc860e284fd29e57b463016eab..86c7243f9a491f112f992ebd4e785f12693f792a 100755
--- a/sky/tools/skydb
+++ b/sky/tools/skydb
@@ -3,7 +3,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import skypy.paths
from skypy.skyserver import SkyServer
import argparse
import json
@@ -12,6 +11,8 @@ import os
import pipes
import requests
import signal
+import skypy.paths
+import StringIO
import subprocess
import sys
import time
@@ -318,7 +319,7 @@ class SkyDebugger(object):
'MojoShellApplication',
'chromium',
]
- subprocess.call(['adb', 'logcat', '-s'] + TAGS)
+ subprocess.call(['adb', 'logcat', '-d', '-s'] + TAGS)
eseidel 2015/01/13 22:58:02 This makes skydb logcat exit immediately insetead
def gdb_attach_command(self, args):
self.paths = self._create_paths_for_build_dir(self.pids['build_dir'])
@@ -331,6 +332,16 @@ class SkyDebugger(object):
# gdb and let it take the entire process.
os.execv(gdb_command[0], gdb_command)
+ def print_crash_command(self, args):
+ logcat_cmd = ['adb', 'logcat', '-d']
+ logcat = subprocess.Popen(logcat_cmd, stdout=subprocess.PIPE)
+
+ stack_path = os.path.join(SRC_ROOT,
+ 'tools', 'android_stack_parser', 'stack')
+ stack = subprocess.Popen([stack_path, '-'], stdin=logcat.stdout)
+ logcat.wait()
+ stack.wait()
+
def main(self):
logging.basicConfig(level=logging.INFO)
logging.getLogger("requests").setLevel(logging.WARNING)
@@ -362,6 +373,10 @@ class SkyDebugger(object):
help=('dump sky-related logs from device'))
logcat_parser.set_defaults(func=self.logcat_command)
+ print_crash_parser = subparsers.add_parser('print_crash',
+ help=('dump (and symbolicate) recent crash-stacks'))
+ print_crash_parser.set_defaults(func=self.print_crash_command)
+
gdb_attach_parser = subparsers.add_parser('gdb_attach',
help='launch gdb and attach to gdbserver launched from start --gdb')
gdb_attach_parser.set_defaults(func=self.gdb_attach_command)
« no previous file with comments | « no previous file | tools/android_stack_parser/stack » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698