OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 | 238 |
239 // Sleep for a number of milliseconds. | 239 // Sleep for a number of milliseconds. |
240 static void Sleep(const int milliseconds); | 240 static void Sleep(const int milliseconds); |
241 | 241 |
242 // Abort the current process. | 242 // Abort the current process. |
243 static void Abort(); | 243 static void Abort(); |
244 | 244 |
245 // Debug break. | 245 // Debug break. |
246 static void DebugBreak(); | 246 static void DebugBreak(); |
247 | 247 |
| 248 // Dump C++ current stack trace (only functional on Linux). |
| 249 static void DumpBacktrace(); |
| 250 |
248 // Walk the stack. | 251 // Walk the stack. |
249 static const int kStackWalkError = -1; | 252 static const int kStackWalkError = -1; |
250 static const int kStackWalkMaxNameLen = 256; | 253 static const int kStackWalkMaxNameLen = 256; |
251 static const int kStackWalkMaxTextLen = 256; | 254 static const int kStackWalkMaxTextLen = 256; |
252 struct StackFrame { | 255 struct StackFrame { |
253 void* address; | 256 void* address; |
254 char text[kStackWalkMaxTextLen]; | 257 char text[kStackWalkMaxTextLen]; |
255 }; | 258 }; |
256 | 259 |
257 static int StackWalk(Vector<StackFrame> frames); | 260 static int StackWalk(Vector<StackFrame> frames); |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 Atomic32 active_; | 796 Atomic32 active_; |
794 PlatformData* data_; // Platform specific data. | 797 PlatformData* data_; // Platform specific data. |
795 int samples_taken_; // Counts stack samples taken. | 798 int samples_taken_; // Counts stack samples taken. |
796 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 799 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
797 }; | 800 }; |
798 | 801 |
799 | 802 |
800 } } // namespace v8::internal | 803 } } // namespace v8::internal |
801 | 804 |
802 #endif // V8_PLATFORM_H_ | 805 #endif // V8_PLATFORM_H_ |
OLD | NEW |