From 54e652d365cceecffc59d80aa0a03e6a9be37e50 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Wed, 3 Jun 2015 11:20:33 -0700 Subject: [PATCH] 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 --- engine/src/flutter/tools/shelldb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/engine/src/flutter/tools/shelldb b/engine/src/flutter/tools/shelldb index 369b5efc57..1fe60a2b2f 100755 --- a/engine/src/flutter/tools/shelldb +++ b/engine/src/flutter/tools/shelldb @@ -44,8 +44,7 @@ PID_FILE_KEYS = frozenset([ 'remote_gdbserver_port', ]) -# TODO(iansf): Fix undefined behavior when you have more than one device attached. -SYSTEM_LIBS_ROOT_PATH = '/tmp/device_libs/%s' % (subprocess.check_output(['adb', 'get-serialno']).strip()) +SYSTEM_LIBS_ROOT_PATH = '/tmp/device_libs' _IGNORED_PATTERNS = [ # Ignored because they're not indicative of specific errors. @@ -343,10 +342,12 @@ class GDBAttach(object): 'target remote localhost:%s' % GDB_PORT, ] - system_lib_dirs = self._pull_system_libraries(pids, - SYSTEM_LIBS_ROOT_PATH) - eval_commands.append( - 'set solib-absolute-prefix %s' % SYSTEM_LIBS_ROOT_PATH) + # TODO(iansf): Fix undefined behavior when you have more than one device attached. + device_id = subprocess.check_output([ADB_PATH, 'get-serialno']).strip() + device_libs_path = os.path.join(SYSTEM_LIBS_ROOT_PATH, device_id) + + 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