Make skydb --gdb work a bit better on Android

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/878163005
This commit is contained in:
Adam Barth
2015-01-28 15:30:31 -08:00
parent a715b93255
commit 763893ce7e
2 changed files with 11 additions and 5 deletions

View File

@@ -4,11 +4,12 @@
# found in the LICENSE file.
import argparse
import re
import sys
import os
import logging
import os
import re
import skypy.paths
import subprocess
import sys
SRC_ROOT = skypy.paths.Paths('ignored').src_root
ADB_PATH = os.path.join(SRC_ROOT,

View File

@@ -126,7 +126,7 @@ class SkyDebugger(object):
'--args-for=mojo:native_viewport_service --use-osmesa')
if is_android and args.gdb:
shell_args.append('--wait_for_debugger')
shell_args.append('--wait-for-debugger')
if 'remote_sky_server_port' in self.pids:
shell_command = self._wrap_for_android(shell_args)
@@ -180,6 +180,11 @@ class SkyDebugger(object):
gn_args = gn_args_from_build_dir(self.paths.build_dir)
is_android = 'android_sdk_version' in gn_args
if is_android and args.gdb and not 'is_debug' in gn_args:
# FIXME: We don't include gdbserver in the release APK...
print "Cannot debug Release builds on Android"
sys.exit(2)
sky_server = self.sky_server_for_args(args)
self.pids['sky_server_pid'] = sky_server.start()
self.pids['sky_server_port'] = sky_server.port
@@ -265,7 +270,7 @@ class SkyDebugger(object):
# We could just run gdb_attach_command here, but when I do that
# it auto-suspends in my zsh. Unclear why.
# self.gdb_attach_command(args)
print "Run skydb gdb_attach to attach."
print "Run 'skydb gdb_attach' to attach."
def _kill_if_exists(self, key, name):
pid = self.pids.pop(key, None)