103#ifdef BLOCXX_HAVE_BACKTRACE
106 size_t size = backtrace (array, 200);
107 char **strings = backtrace_symbols (array, size);
112 for (i = 0; i < size; i++)
114#if defined(BLOCXX_HAVE_CXXABI_H)
118 char* firstparen = ::strchr(strings[i],
'(');
119 char* lastparen = ::strchr(strings[i],
'+');
120 if (firstparen != 0 && lastparen != 0 && firstparen < lastparen)
124 char* realname = abi::__cxa_demangle(firstparen+1, 0, 0, &status);
142 String scriptName(
"/tmp/owgdb-");
143 String outputName(
"/tmp/owgdbout-");
145 outputName +=
String(UInt32(::getpid()));
146 scriptName +=
String(UInt32(::getpid())) +
".sh";
148 exeName +=
String(UInt32(::getpid())) +
"/exe";
150 ofstream scriptFile(scriptName.
c_str(), std::ios::out);
151 scriptFile <<
"#!/bin/sh\n"
152 <<
"gdb " << exeName <<
" " << ::getpid() <<
" << EOS > " << outputName <<
" 2>&1\n"
163 ifstream outputFile(outputName.
c_str(), std::ios::in);
171 unlink(outputName.
c_str());
172 unlink(scriptName.
c_str());