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

Unified Diff: tracing/bin/symbolize_trace

Issue 2698543003: Use absolute pcs and load locations to symbolize on macOS. (Closed)
Patch Set: Created 3 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/bin/symbolize_trace
diff --git a/tracing/bin/symbolize_trace b/tracing/bin/symbolize_trace
index adb26739cce3c75165c50ab153e0cb2cde19d0c3..c5646e3aba5a430ca1ba202594c7d58a289d5792 100755
--- a/tracing/bin/symbolize_trace
+++ b/tracing/bin/symbolize_trace
@@ -96,7 +96,8 @@ class Symbolizer(object):
chars_per_address = 19
cmd_base = [self.symbolizer_path, '-arch', 'x86_64', '-l',
- '0x0', '-o' , symfile.symbolizable_path]
+ '0x%x' % symfile.region_start_address, '-o',
+ symfile.symbolizable_path]
chars_for_other_arguments = len(' '.join(cmd_base)) + 1
# The maximum number of inputs that can be processed at once is limited by
@@ -110,7 +111,8 @@ class Symbolizer(object):
keys_to_process = all_keys[0:input_count]
cmd = list(cmd_base)
- cmd.extend([hex(int(x)) for x in keys_to_process])
+ cmd.extend([hex(int(x) + symfile.region_start_address)
+ for x in keys_to_process])
output_array = subprocess.check_output(cmd).split('\n')
for i in range(len(keys_to_process)):
for frame in symfile.frames_by_address.values()[i + processed_keys_count]:
@@ -318,6 +320,7 @@ class SymbolizableFile(object):
self.path = file_path
self.symbolizable_path = file_path # path to use for symbolization
self.frames_by_address = collections.defaultdict(list)
+ self.region_start_address = 0
def ResolveSymbolizableFiles(processes):
@@ -341,6 +344,7 @@ def ResolveSymbolizableFiles(processes):
symfile_by_path[symfile.path] = symfile
relative_pc = frame.pc - region.start_address
+ symfile.region_start_address = region.start_address
DmitrySkiba 2017/02/15 22:40:38 Hmm, this overwrites the whatever value region_sta
symfile.frames_by_address[relative_pc].append(frame)
return symfile_by_path.values()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698