Commit be9198d1 authored by Daniel Cheng's avatar Daniel Cheng Committed by Commit Bot

Android stack symbolizer: clamp padding on symbolized names at 80 cols

Change-Id: Ic77300a39d6f7cd6e58ada65393a7b2cd131cd47
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1603347
Auto-Submit: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658392}
parent 1ea862a3
...@@ -47,4 +47,5 @@ Speedup symbolization by avoiding unnecessary APK manifest extraction loops. ...@@ -47,4 +47,5 @@ Speedup symbolization by avoiding unnecessary APK manifest extraction loops.
Changed the symbolizer to act in a passthrough mode when reading from stdin, so Changed the symbolizer to act in a passthrough mode when reading from stdin, so
adb logcat can be piped through it to symbolize on the fly. adb logcat can be piped through it to symbolize on the fly.
Made the symbolizer agnostic to the width of pointers. Made the symbolizer agnostic to the width of pointers.
\ No newline at end of file Clamping the padding on symbolized names to 80 columns.
...@@ -104,7 +104,7 @@ _SHARED_LIB_OFFSET_IN_APK = re.compile(' \(offset 0x(?P<offset>[0-9a-f]{0,16})\) ...@@ -104,7 +104,7 @@ _SHARED_LIB_OFFSET_IN_APK = re.compile(' \(offset 0x(?P<offset>[0-9a-f]{0,16})\)
def PrintTraceLines(trace_lines): def PrintTraceLines(trace_lines):
"""Print back trace.""" """Print back trace."""
maxlen = max(map(lambda tl: len(tl[1]), trace_lines)) maxlen = min(80, max(map(lambda tl: len(tl[1]), trace_lines)))
print print
print 'Stack Trace:' print 'Stack Trace:'
print ' RELADDR ' + 'FUNCTION'.ljust(maxlen) + ' FILE:LINE' print ' RELADDR ' + 'FUNCTION'.ljust(maxlen) + ' FILE:LINE'
...@@ -117,7 +117,7 @@ def PrintTraceLines(trace_lines): ...@@ -117,7 +117,7 @@ def PrintTraceLines(trace_lines):
def PrintValueLines(value_lines): def PrintValueLines(value_lines):
"""Print stack data values.""" """Print stack data values."""
maxlen = max(map(lambda tl: len(tl[2]), value_lines)) maxlen = min(80, max(map(lambda tl: len(tl[2]), value_lines)))
print print
print 'Stack Data:' print 'Stack Data:'
print ' ADDR VALUE ' + 'FUNCTION'.ljust(maxlen) + ' FILE:LINE' print ' ADDR VALUE ' + 'FUNCTION'.ljust(maxlen) + ' FILE:LINE'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment