76 #include <include/hpctoolkit-config.h> 85 #define CXX_DEMANGLER_FN_NAME "__cxa_demangle" 94 std::cerr <<
"WARNING: Unable to open user-specified C++ demangler library '" 95 << demangler_library_filename <<
"'" << std::endl;
97 std::cerr <<
" Dynamic library error: '" << error_string <<
"'" 100 std::cerr <<
" Using default demangler instead." << std::endl;
107 if (demangler_library_filename) {
108 static void *demangler_library_handle =
109 dlopen(demangler_library_filename, RTLD_LAZY | RTLD_LOCAL);
111 if (demangler_library_handle) {
115 dlsym(demangler_library_handle, demangler_function);
137 catch (
const std::bad_alloc& x) {
138 DIAG_EMsg(
"[std::bad_alloc] " << x.what());
141 catch (
const std::exception& x) {
142 DIAG_EMsg(
"[std::exception] " << x.what());
146 DIAG_EMsg(
"Unknown exception encountered!");
184 omp_set_num_threads(1);
214 std::streambuf* os_buf = outFile->rdbuf();
217 std::string gapsName =
"";
218 std::ostream* gapsFile =
NULL;
219 char* gapsBuf =
NULL;
220 std::streambuf* gaps_rdbuf =
NULL;
225 DIAG_EMsg(
"Cannot make gaps file when hpcstruct file is stdout.");
229 gapsName =
RealPath(osnm) + std::string(
".gaps");
232 gaps_rdbuf = gapsFile->rdbuf();
252 if (gapsFile !=
NULL) {
#define CXX_DEMANGLER_FN_NAME
void CloseStream(std::istream *s)
static demangler_t demangle_fn
std::string demangle_function
static int realmain(int argc, char *argv[])
static RealPathMgr & singleton()
std::string searchPathStr
std::ostream * OpenOStream(const char *filenm)
virtual std::string message() const
bool realpath(std::string &pathNm) const
void makeStructure(string filename, ostream *outFile, ostream *gapsFile, string gaps_filenm, string search_path, Struct::Options &structOpts)
int main(int argc, char *argv[])
static BAnal::Struct::Options opts
const std::string & searchPaths() const
void hpctoolkit_demangler_set(demangler_t _demangle_fn)
const char * RealPath(const char *nm)
char *(* demangler_t)(const char *mangled_name, char *output_buffer, size_t *length, int *status)
static void hpctoolkit_demangler_init(const char *demangler_library_filename, const char *demangler_function)
std::string demangle_library
static void hpctoolkit_demangler_error(char *error_string, const char *demangler_library_filename)