Changeset 213718 in webkit
- Timestamp:
- Mar 10, 2017 11:01:57 AM (7 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r213714 r213718 925 925 tools/JSDollarVMPrototype.cpp 926 926 tools/SigillCrashAnalyzer.cpp 927 tools/StackTrace.cpp 927 928 tools/VMInspector.cpp 928 929 -
trunk/Source/JavaScriptCore/ChangeLog
r213714 r213718 1 2017-03-10 Mark Lam <mark.lam@apple.com> 2 3 [Re-landing] Implement a StackTrace utility object that can capture stack traces for debugging. 4 https://bugs.webkit.org/show_bug.cgi?id=169454 5 6 Reviewed by Michael Saboff. 7 8 The underlying implementation is hoisted right out of Assertions.cpp from the 9 implementations of WTFPrintBacktrace(). 10 11 The reason we need this StackTrace object is because during heap debugging, we 12 sometimes want to capture the stack trace that allocated the objects of interest. 13 Dumping the stack trace directly to stdout (using WTFReportBacktrace()) may 14 perturb the execution profile sufficiently that an issue may not reproduce, 15 while alternatively, just capturing the stack trace and deferring printing it 16 till we actually need it later perturbs the execution profile less. 17 18 In addition, just capturing the stack traces (instead of printing them 19 immediately at each capture site) allows us to avoid polluting stdout with tons 20 of stack traces that may be irrelevant. 21 22 For now, we only capture the native stack trace. We'll leave capturing and 23 integrating the JS stack trace as an exercise for the future if we need it then. 24 25 Here's an example of how to use this StackTrace utility: 26 27 // Capture a stack trace of the top 10 frames. 28 std::unique_ptr<StackTrace> trace(StackTrace::captureStackTrace(10)); 29 // Print the trace. 30 dataLog(*trace); 31 32 * CMakeLists.txt: 33 * JavaScriptCore.xcodeproj/project.pbxproj: 34 * tools/StackTrace.cpp: Added. 35 (JSC::StackTrace::instanceSize): 36 (JSC::StackTrace::captureStackTrace): 37 (JSC::StackTrace::dump): 38 * tools/StackTrace.h: Added. 39 (JSC::StackTrace::size): 40 (JSC::StackTrace::StackTrace): 41 1 42 2017-03-04 Filip Pizlo <fpizlo@apple.com> 2 43 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r213714 r213718 2372 2372 FE1BD0241E72053800134BC9 /* HeapVerifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE1BD0221E72052F00134BC9 /* HeapVerifier.cpp */; }; 2373 2373 FE1BD0251E72053800134BC9 /* HeapVerifier.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1BD0231E72052F00134BC9 /* HeapVerifier.h */; }; 2374 FE1BD02B1E721B4C00134BC9 /* StackTrace.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1BD02A1E721B3700134BC9 /* StackTrace.h */; }; 2375 FE1BD02C1E721B5100134BC9 /* StackTrace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE1BD0291E721B3700134BC9 /* StackTrace.cpp */; }; 2374 2376 FE1C0FFD1B193E9800B53FCA /* Exception.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1C0FFC1B193E9800B53FCA /* Exception.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2375 2377 FE1C0FFF1B194FD100B53FCA /* Exception.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE1C0FFE1B194FD100B53FCA /* Exception.cpp */; }; … … 4958 4960 FE1BD0221E72052F00134BC9 /* HeapVerifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HeapVerifier.cpp; sourceTree = "<group>"; }; 4959 4961 FE1BD0231E72052F00134BC9 /* HeapVerifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapVerifier.h; sourceTree = "<group>"; }; 4962 FE1BD0291E721B3700134BC9 /* StackTrace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StackTrace.cpp; sourceTree = "<group>"; }; 4963 FE1BD02A1E721B3700134BC9 /* StackTrace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StackTrace.h; sourceTree = "<group>"; }; 4960 4964 FE1C0FFC1B193E9800B53FCA /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Exception.h; sourceTree = "<group>"; }; 4961 4965 FE1C0FFE1B194FD100B53FCA /* Exception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Exception.cpp; sourceTree = "<group>"; }; … … 6956 6960 FE3022D01E3D739600BAC493 /* SigillCrashAnalyzer.cpp */, 6957 6961 FE3022D11E3D739600BAC493 /* SigillCrashAnalyzer.h */, 6962 FE1BD0291E721B3700134BC9 /* StackTrace.cpp */, 6963 FE1BD02A1E721B3700134BC9 /* StackTrace.h */, 6958 6964 86B5826A14D35D5100A9C306 /* TieredMMapArray.h */, 6959 6965 FE3022D41E42856700BAC493 /* VMInspector.cpp */, … … 8760 8766 0F46808214BA572D00BFE272 /* JITExceptions.h in Headers */, 8761 8767 0FB14E1F18124ACE009B6B4D /* JITInlineCacheGenerator.h in Headers */, 8768 FE1BD02B1E721B4C00134BC9 /* StackTrace.h in Headers */, 8762 8769 86CC85A10EE79A4700288682 /* JITInlines.h in Headers */, 8763 8770 FE3A06BE1C11041200390FDD /* JITLeftShiftGenerator.h in Headers */, … … 10201 10208 0FDB2CE7174830A2007B3C1B /* DFGWorklist.cpp in Sources */, 10202 10209 0FE050171AA9091100D33B33 /* DirectArguments.cpp in Sources */, 10210 FE1BD02C1E721B5100134BC9 /* StackTrace.cpp in Sources */, 10203 10211 0FE050151AA9091100D33B33 /* DirectArgumentsOffset.cpp in Sources */, 10204 10212 0F2EBBAB1DEDF95000990369 /* DirectEvalCodeCache.cpp in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.