Don't run adb as part of shelldb boot

This defers running adb until we actually need the device-id
which makes shelldb not crash when adb isn't avaiable.

I also fixed to use ADB_PATH.

Chinmay ran into this when trying shelldb on Mac.

R=chinmaygarde@google.com, iansf@google.com

Review URL: https://codereview.chromium.org/1161843007
This commit is contained in:
Eric Seidel 2015-06-03 11:20:33 -07:00
parent 8d6e3bef6e
commit 54e652d365

View File

@ -44,8 +44,7 @@ PID_FILE_KEYS = frozenset([
'remote_gdbserver_port', 'remote_gdbserver_port',
]) ])
# TODO(iansf): Fix undefined behavior when you have more than one device attached. SYSTEM_LIBS_ROOT_PATH = '/tmp/device_libs'
SYSTEM_LIBS_ROOT_PATH = '/tmp/device_libs/%s' % (subprocess.check_output(['adb', 'get-serialno']).strip())
_IGNORED_PATTERNS = [ _IGNORED_PATTERNS = [
# Ignored because they're not indicative of specific errors. # Ignored because they're not indicative of specific errors.
@ -343,10 +342,12 @@ class GDBAttach(object):
'target remote localhost:%s' % GDB_PORT, 'target remote localhost:%s' % GDB_PORT,
] ]
system_lib_dirs = self._pull_system_libraries(pids, # TODO(iansf): Fix undefined behavior when you have more than one device attached.
SYSTEM_LIBS_ROOT_PATH) device_id = subprocess.check_output([ADB_PATH, 'get-serialno']).strip()
eval_commands.append( device_libs_path = os.path.join(SYSTEM_LIBS_ROOT_PATH, device_id)
'set solib-absolute-prefix %s' % SYSTEM_LIBS_ROOT_PATH)
system_lib_dirs = self._pull_system_libraries(pids, device_libs_path)
eval_commands.append('set solib-absolute-prefix %s' % device_libs_path)
symbol_search_paths = system_lib_dirs + symbol_search_paths symbol_search_paths = system_lib_dirs + symbol_search_paths