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

Side by Side Diff: mojo/devtools/common/android_stack_parser/symbol.py

Issue 1312283003: Allow several build directories to be specified to search for symbols (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 unified diff | Download patch
« no previous file with comments | « mojo/devtools/common/android_stack_parser/stack ('k') | mojo/devtools/common/mojo_debug » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (C) 2013 The Android Open Source Project 1 # Copyright (C) 2013 The Android Open Source Project
2 # 2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); 3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License. 4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at 5 # You may obtain a copy of the License at
6 # 6 #
7 # http://www.apache.org/licenses/LICENSE-2.0 7 # http://www.apache.org/licenses/LICENSE-2.0
8 # 8 #
9 # Unless required by applicable law or agreed to in writing, software 9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, 10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and 12 # See the License for the specific language governing permissions and
13 # limitations under the License. 13 # limitations under the License.
14 14
15 """Module for looking up symbolic debugging information. 15 """Module for looking up symbolic debugging information.
16 16
17 The information can include symbol names, offsets, and source locations. 17 The information can include symbol names, offsets, and source locations.
18 """ 18 """
19 19
20 import glob 20 import glob
21 import itertools 21 import itertools
22 import os 22 import os
23 import re 23 import re
24 import subprocess 24 import subprocess
25 import zipfile 25 import zipfile
26 26
27 NDK_DIR = "" 27 NDK_DIR = ""
28 BUILD_DIR = "" 28 BUILD_DIRS = []
29 SYMBOLS_DIR = "" 29 SYMBOLS_DIR = ""
30 30
31 ARCH = "arm" 31 ARCH = "arm"
32 32
33 TOOLCHAIN_INFO = None 33 TOOLCHAIN_INFO = None
34 34
35 def Uname(): 35 def Uname():
36 """'uname' for constructing prebuilt/<...> and out/host/<...> paths.""" 36 """'uname' for constructing prebuilt/<...> and out/host/<...> paths."""
37 uname = os.uname()[0] 37 uname = os.uname()[0]
38 proc = os.uname()[-1] 38 proc = os.uname()[-1]
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 """Returns a list of candidate filenames. 183 """Returns a list of candidate filenames.
184 184
185 Args: 185 Args:
186 filepart: the file part of the pathname. 186 filepart: the file part of the pathname.
187 candidate_fun: a function to apply to each candidate, returns a list. 187 candidate_fun: a function to apply to each candidate, returns a list.
188 relative_dirs: a list of relative directory names to search from. 188 relative_dirs: a list of relative directory names to search from.
189 189
190 Returns: 190 Returns:
191 A list of candidate files ordered by modification time, newest first. 191 A list of candidate files ordered by modification time, newest first.
192 """ 192 """
193 candidates = [BUILD_DIR] 193 candidates = list(BUILD_DIRS)
194 194
195 if relative_dirs: 195 if relative_dirs:
196 candidates = PathListJoin(candidates, relative_dirs) 196 candidates = PathListJoin(candidates, relative_dirs)
197 197
198 candidates = PathListJoin(candidates, [filepart]) 198 candidates = PathListJoin(candidates, [filepart])
199 candidates = list( 199 candidates = list(
200 itertools.chain.from_iterable(map(candidate_fun, candidates))) 200 itertools.chain.from_iterable(map(candidate_fun, candidates)))
201 candidates = sorted(candidates, key=os.path.getmtime, reverse=True) 201 candidates = sorted(candidates, key=os.path.getmtime, reverse=True)
202 return candidates 202 return candidates
203 203
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 process.stdin.write("\n") 554 process.stdin.write("\n")
555 process.stdin.close() 555 process.stdin.close()
556 demangled_symbol = process.stdout.readline().strip() 556 demangled_symbol = process.stdout.readline().strip()
557 process.stdout.close() 557 process.stdout.close()
558 return demangled_symbol 558 return demangled_symbol
559 559
560 def FormatSymbolWithOffset(symbol, offset): 560 def FormatSymbolWithOffset(symbol, offset):
561 if offset == 0: 561 if offset == 0:
562 return symbol 562 return symbol
563 return "%s+%d" % (symbol, offset) 563 return "%s+%d" % (symbol, offset)
OLDNEW
« no previous file with comments | « mojo/devtools/common/android_stack_parser/stack ('k') | mojo/devtools/common/mojo_debug » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698