GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — node-1/src/backtrace_posix.cc at master · patrickandre/node-1 Expand file tree/ Copy pathbacktrace_posix.ccMore file actions 52 lines (46 loc) · 1.12 KB / Copy pathbacktrace_posix.ccFile metadata and controls52 lines (46 loc) · 1.12 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 #include "node.h" #if defined(__linux__) #include <features.h> #endif #if defined(__linux__) && !defined(__GLIBC__) || \ defined(__UCLIBC__) || \ defined(_AIX) #define HAVE_EXECINFO_H 0 #else #define HAVE_EXECINFO_H 1 #endif #if HAVE_EXECINFO_H #include <cxxabi.h> #include <dlfcn.h> #include <execinfo.h> #include <stdio.h> #endif namespace node { void DumpBacktrace(FILE* fp) { #if HAVE_EXECINFO_H void* frames[256]; const int size = backtrace(frames, arraysize(frames)); if (size <= 0) { return; } for (int i = 1; i < size; i += 1) { void* frame = frames[i]; fprintf(fp, "%2d: ", i); Dl_info info; const bool have_info = dladdr(frame, &info); if (!have_info || info.dli_sname == nullptr) { fprintf(fp, "%p", frame); } else if (char* demangled = abi::__cxa_demangle(info.dli_sname, 0, 0, 0)) { fprintf(fp, "%s", demangled); free(demangled); } else { fprintf(fp, "%s", info.dli_sname); } if (have_info && info.dli_fname != nullptr) { fprintf(fp, " [%s]", info.dli_fname); } fprintf(fp, "\n"); } #endif // HAVE_EXECINFO_H } } // namespace node |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |