Chromium Code Reviews| Index: appengine/findit/crash/callstack_filters.py |
| diff --git a/appengine/findit/crash/callstack_filters.py b/appengine/findit/crash/callstack_filters.py |
| index 2ff2c693e1daf3855230e614619feb2991a6ba6f..c8d91aa1d09e3e63798b03443c73e93afedfc713 100644 |
| --- a/appengine/findit/crash/callstack_filters.py |
| +++ b/appengine/findit/crash/callstack_filters.py |
| @@ -4,21 +4,28 @@ |
| import re |
| +from crash.callstack import CallStack |
| -def FilterFramesBeforeSignature(callstack, signature): |
| - """Filter all the stack frames before the signature frame. |
| - Note: The callstack is filtered in place. |
| - """ |
| - if not signature: |
| - return |
| +_INLINE_FUNCTION_FILE_PATH_MARKERS = [ |
| + 'third_party/llvm-build/Release+Asserts/include/c++/v1/', |
| + 'linux/debian_wheezy_amd64-sysroot/usr/include/c++/4.6/bits/', |
| + 'eglibc-3GlaMS/eglibc-2.19/sysdeps/unix/', |
| +] |
| + |
| - signature_frame_index = 0 |
| - # Filter out the types of signature, for example [Out of Memory]. |
| - signature = re.sub('[[][^]]*[]]\s*', '', signature) |
| +def FilterInlineFunctionFrames(callstack): |
| + """Filters all the stack frames with inline function file paths. |
| + |
| + File paths that generated in runtime are not the oringinal file paths. They |
|
stgao
2016/05/17 00:30:34
This seems incorrect to me.
The file paths above
Sharu Jiang
2016/05/17 18:34:58
Changed to a safer description.
|
| + should be filtered out. |
| + """ |
| + def _IsNonInlineFunctionFrame(frame): |
| + for path_marker in _INLINE_FUNCTION_FILE_PATH_MARKERS: |
| + if path_marker in frame.file_path: |
| + return False |
| - for index, frame in enumerate(callstack): |
| - if signature in frame.function: |
| - signature_frame_index = index |
| + return True |
| - callstack[:] = callstack[signature_frame_index:] |
| + return CallStack(callstack.priority, callstack.format_type, |
| + filter(_IsNonInlineFunctionFrame, callstack)) |