| 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 20 matching lines...) Expand all Loading... |
| 31 #if !defined(ANDROID) | 31 #if !defined(ANDROID) |
| 32 #include <cxxabi.h> | 32 #include <cxxabi.h> |
| 33 #endif | 33 #endif |
| 34 #include <stdio.h> | 34 #include <stdio.h> |
| 35 | 35 |
| 36 #include "platform.h" | 36 #include "platform.h" |
| 37 | 37 |
| 38 namespace v8 { | 38 namespace v8 { |
| 39 namespace internal { | 39 namespace internal { |
| 40 | 40 |
| 41 // Used by platform implementation files during OS::PostSetUp(). | |
| 42 void POSIXPostSetUp(); | |
| 43 | |
| 44 // Used by platform implementation files during OS::DumpBacktrace() | 41 // Used by platform implementation files during OS::DumpBacktrace() |
| 45 // and OS::StackWalk(). | 42 // and OS::StackWalk(). |
| 46 template<int (*backtrace)(void**, int), | 43 template<int (*backtrace)(void**, int), |
| 47 char** (*backtrace_symbols)(void* const*, int)> | 44 char** (*backtrace_symbols)(void* const*, int)> |
| 48 struct POSIXBacktraceHelper { | 45 struct POSIXBacktraceHelper { |
| 49 static void DumpBacktrace() { | 46 static void DumpBacktrace() { |
| 50 void* trace[100]; | 47 void* trace[100]; |
| 51 int size = backtrace(trace, ARRAY_SIZE(trace)); | 48 int size = backtrace(trace, ARRAY_SIZE(trace)); |
| 52 char** symbols = backtrace_symbols(trace, size); | 49 char** symbols = backtrace_symbols(trace, size); |
| 53 fprintf(stderr, "\n==== C stack trace ===============================\n\n"); | 50 fprintf(stderr, "\n==== C stack trace ===============================\n\n"); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 97 |
| 101 free(symbols); | 98 free(symbols); |
| 102 | 99 |
| 103 return frames_count; | 100 return frames_count; |
| 104 } | 101 } |
| 105 }; | 102 }; |
| 106 | 103 |
| 107 } } // namespace v8::internal | 104 } } // namespace v8::internal |
| 108 | 105 |
| 109 #endif // V8_PLATFORM_POSIX_H_ | 106 #endif // V8_PLATFORM_POSIX_H_ |
| OLD | NEW |