Revision f230a1cf deps/v8/src/platform-macos.cc
deps/v8/src/platform-macos.cc | ||
---|---|---|
53 | 53 |
#include <stdlib.h> |
54 | 54 |
#include <string.h> |
55 | 55 |
#include <errno.h> |
56 |
#include <cxxabi.h> |
|
57 | 56 |
|
58 | 57 |
#undef MAP_TYPE |
59 | 58 |
|
60 | 59 |
#include "v8.h" |
61 | 60 |
|
62 |
#include "platform-posix.h" |
|
63 | 61 |
#include "platform.h" |
64 | 62 |
#include "simulator.h" |
65 | 63 |
#include "vm-state-inl.h" |
66 | 64 |
|
67 |
// Manually define these here as weak imports, rather than including execinfo.h. |
|
68 |
// This lets us launch on 10.4 which does not have these calls. |
|
69 |
extern "C" { |
|
70 |
extern int backtrace(void**, int) __attribute__((weak_import)); |
|
71 |
extern char** backtrace_symbols(void* const*, int) |
|
72 |
__attribute__((weak_import)); |
|
73 |
extern void backtrace_symbols_fd(void* const*, int, int) |
|
74 |
__attribute__((weak_import)); |
|
75 |
} |
|
76 |
|
|
77 | 65 |
|
78 | 66 |
namespace v8 { |
79 | 67 |
namespace internal { |
... | ... | |
107 | 95 |
} |
108 | 96 |
|
109 | 97 |
|
110 |
void OS::DumpBacktrace() { |
|
111 |
// If weak link to execinfo lib has failed, ie because we are on 10.4, abort. |
|
112 |
if (backtrace == NULL) return; |
|
113 |
|
|
114 |
POSIXBacktraceHelper<backtrace, backtrace_symbols>::DumpBacktrace(); |
|
115 |
} |
|
116 |
|
|
117 |
|
|
118 | 98 |
class PosixMemoryMappedFile : public OS::MemoryMappedFile { |
119 | 99 |
public: |
120 | 100 |
PosixMemoryMappedFile(FILE* file, void* memory, int size) |
... | ... | |
220 | 200 |
} |
221 | 201 |
|
222 | 202 |
|
223 |
int OS::StackWalk(Vector<StackFrame> frames) { |
|
224 |
// If weak link to execinfo lib has failed, ie because we are on 10.4, abort. |
|
225 |
if (backtrace == NULL) return 0; |
|
226 |
|
|
227 |
return POSIXBacktraceHelper<backtrace, backtrace_symbols>::StackWalk(frames); |
|
228 |
} |
|
229 |
|
|
230 |
|
|
231 | 203 |
VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } |
232 | 204 |
|
233 | 205 |
|
Also available in: Unified diff