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

Unified Diff: third_party/android_platform/development/scripts/stack_core.py

Issue 1884873004: Revert of ⛄ Capture Android stderr when symbolizing native stack traces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « third_party/android_platform/README.chromium ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/android_platform/development/scripts/stack_core.py
diff --git a/third_party/android_platform/development/scripts/stack_core.py b/third_party/android_platform/development/scripts/stack_core.py
index f04659eeaac9961e908e200b92ce6b18aef63de9..9ef2e300996e8894ff7e32f1a7505e6b6dfeeacd 100755
--- a/third_party/android_platform/development/scripts/stack_core.py
+++ b/third_party/android_platform/development/scripts/stack_core.py
@@ -36,14 +36,11 @@
_LIBCHROME_SO = 'libchrome.so'
_PROCESS_INFO_LINE = re.compile('(pid: [0-9]+, tid: [0-9]+.*)')
-# Same as above, but used to extract the pid.
-_PROCESS_INFO_PID = re.compile('pid: ([0-9]+)')
_SIGNAL_LINE = re.compile('(signal [0-9]+ \(.*\).*)')
_REGISTER_LINE = re.compile('(([ ]*[0-9a-z]{2} [0-9a-f]{8}){4})')
_THREAD_LINE = re.compile('(.*)(\-\-\- ){15}\-\-\-')
_DALVIK_JNI_THREAD_LINE = re.compile("(\".*\" prio=[0-9]+ tid=[0-9]+ NATIVE.*)")
_DALVIK_NATIVE_THREAD_LINE = re.compile("(\".*\" sysTid=[0-9]+ nice=[0-9]+.*)")
-_JAVA_STDERR_LINE = re.compile("([0-9]+)\s+[0-9]+\s+.\s+System.err:\s*(.+)")
_WIDTH = '{8}'
if symbol.ARCH == 'arm64' or symbol.ARCH == 'x86_64' or symbol.ARCH == 'x64':
@@ -117,16 +114,7 @@
return
-def PrintJavaLines(java_lines):
- """Print java stderr lines."""
- print
- print 'Java stderr from crashing pid (may identify underlying Java exception):'
- for l in java_lines:
- if l.startswith('at'):
- print ' ',
- print l
-
-def PrintOutput(trace_lines, value_lines, java_lines, more_info):
+def PrintOutput(trace_lines, value_lines, more_info):
if trace_lines:
PrintTraceLines(trace_lines)
if value_lines:
@@ -137,8 +125,6 @@
# libraries), don't completely disable them.
if more_info:
PrintValueLines(value_lines)
- if java_lines:
- PrintJavaLines(java_lines)
def PrintDivider():
print
@@ -205,8 +191,7 @@
or _DALVIK_JNI_THREAD_LINE.search(line)
or _DALVIK_NATIVE_THREAD_LINE.search(line)
or _LOG_FATAL_LINE.search(line)
- or _DEBUG_TRACE_LINE.match(line)
- or _JAVA_STDERR_LINE.search(line)):
+ or _DEBUG_TRACE_LINE.match(line)):
useful_log.append(line)
continue
@@ -240,7 +225,6 @@
trace_lines = []
value_lines = []
last_frame = -1
- pid = -1
# It is faster to get symbol information with a single call rather than with
# separate calls for each line. Since symbol.SymbolInformation caches results,
@@ -248,10 +232,6 @@
# from the log and call symbol.SymbolInformation so that the results are
# cached in the following lookups.
code_addresses = {}
-
- # Collects all java exception lines, keyed by pid for later output during
- # native crash handling.
- java_stderr_by_pid = {}
for line in lines:
lib, address = None, None
@@ -265,11 +245,6 @@
if lib:
code_addresses.setdefault(lib, set()).add(address)
-
- java_stderr_match = _JAVA_STDERR_LINE.search(line)
- if java_stderr_match:
- pid, msg = java_stderr_match.groups()
- java_stderr_by_pid.setdefault(pid, []).append(msg)
for lib in code_addresses:
symbol.SymbolInformationForSet(
@@ -289,18 +264,12 @@
dalvik_jni_thread_header or dalvik_native_thread_header or
log_fatal_header) :
if trace_lines or value_lines:
- java_lines = []
- if pid != -1 and pid in java_stderr_by_pid:
- java_lines = java_stderr_by_pid[pid]
- PrintOutput(trace_lines, value_lines, java_lines, more_info)
+ PrintOutput(trace_lines, value_lines, more_info)
PrintDivider()
trace_lines = []
value_lines = []
last_frame = -1
- pid = -1
if process_header:
- # Track the last reported pid to find java exceptions.
- pid = _PROCESS_INFO_PID.search(process_header.group(1)).group(1)
print process_header.group(1)
if signal_header:
print signal_header.group(1)
@@ -323,14 +292,10 @@
logging.debug('Found trace line: %s' % line.strip())
if frame <= last_frame and (trace_lines or value_lines):
- java_lines = []
- if pid != -1 and pid in java_stderr_by_pid:
- java_lines = java_stderr_by_pid[pid]
- PrintOutput(trace_lines, value_lines, java_lines, more_info)
+ PrintOutput(trace_lines, value_lines, more_info)
PrintDivider()
trace_lines = []
value_lines = []
- pid = -1
last_frame = frame
if area == UNKNOWN or area == HEAP or area == STACK:
@@ -381,7 +346,4 @@
object_symbol_with_offset,
source_location))
- java_lines = []
- if pid != -1 and pid in java_exceptions:
- java_lines = java_exceptions[pid]
- PrintOutput(trace_lines, value_lines, java_lines, more_info)
+ PrintOutput(trace_lines, value_lines, more_info)
« no previous file with comments | « third_party/android_platform/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698