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

Unified Diff: mojo/devtools/common/android_gdb/session.py

Issue 1325593004: Allow mojo_debug gdb attach to search symbols in multiple directories. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 3 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 | mojo/devtools/common/mojo_debug » ('j') | mojo/devtools/common/mojo_debug » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/devtools/common/android_gdb/session.py
diff --git a/mojo/devtools/common/android_gdb/session.py b/mojo/devtools/common/android_gdb/session.py
index e425c40e6be4e01afc01beb4fd544a1a53560675..525778039eb686dfe39eaf0b2cb6d73b4ba1ccec 100644
--- a/mojo/devtools/common/android_gdb/session.py
+++ b/mojo/devtools/common/android_gdb/session.py
@@ -71,9 +71,10 @@ def _get_mapped_files():
class DebugSession(object):
- def __init__(self, build_directory, package_name, pyelftools_dir, adb):
- self._build_directory = build_directory
- if not os.path.exists(self._build_directory):
+ def __init__(self, build_directory_list, package_name, pyelftools_dir, adb):
+ build_directories = build_directory_list.split(',')
+ if len(build_directories) == 0 or not all(map(os.path.exists,
+ build_directories)):
logging.fatal("Please pass a valid build directory")
qsr (NOT THE RIGHT qsr) 2015/09/03 10:34:04 The message might need to be changed, no?
etiennej 2015/09/03 11:45:44 Done.
sys.exit(1)
self._package_name = package_name
@@ -92,7 +93,7 @@ class DebugSession(object):
self._elffile_module = elffile
- self._libraries = self._find_libraries(build_directory)
+ self._libraries = self._find_libraries(build_directories)
self._rfc = RemoteFileConnection('localhost', 10000)
self._remote_file_reader_process = None
if not os.path.exists(self._remote_file_cache):
@@ -111,15 +112,16 @@ class DebugSession(object):
if self._remote_file_reader_process != None:
self._remote_file_reader_process.kill()
- def _find_libraries(self, lib_dir):
- """Finds all libraries in |lib_dir| and key them by their signatures.
+ def _find_libraries(self, lib_dirs):
+ """Finds all libraries in |lib_dirs| and key them by their signatures.
"""
res = {}
- for fn in glob.glob('%s/*.so' % lib_dir):
- with open(fn, 'r') as f:
- s = get_signature(f, self._elffile_module)
- if s is not None:
- res[s] = fn
+ for lib_dir in lib_dirs:
+ for fn in glob.glob('%s/*.so' % lib_dir):
+ with open(fn, 'r') as f:
+ s = get_signature(f, self._elffile_module)
+ if s is not None:
+ res[s] = fn
return res
def _associate_symbols(self, mapping, local_file):
« no previous file with comments | « no previous file | mojo/devtools/common/mojo_debug » ('j') | mojo/devtools/common/mojo_debug » ('J')

Powered by Google App Engine
This is Rietveld 408576698