diff options
author | Bernard Normier <bernard@zeroc.com> | 2016-05-04 19:22:53 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2016-05-04 19:22:53 +0000 |
commit | d557df5f678da3bfc0f988e40dd581e4998c95f4 (patch) | |
tree | d3f9139bf09f63212c69edeb8d326300368a5b9b /cpp/test/IceUtil/stacktrace/Client.cpp | |
parent | Added missing Makefile.mk for php (diff) | |
download | ice-d557df5f678da3bfc0f988e40dd581e4998c95f4.tar.bz2 ice-d557df5f678da3bfc0f988e40dd581e4998c95f4.tar.xz ice-d557df5f678da3bfc0f988e40dd581e4998c95f4.zip |
Fix for static builds
Diffstat (limited to 'cpp/test/IceUtil/stacktrace/Client.cpp')
-rw-r--r-- | cpp/test/IceUtil/stacktrace/Client.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cpp/test/IceUtil/stacktrace/Client.cpp b/cpp/test/IceUtil/stacktrace/Client.cpp index 9e47d7cbf73..8862596d024 100644 --- a/cpp/test/IceUtil/stacktrace/Client.cpp +++ b/cpp/test/IceUtil/stacktrace/Client.cpp @@ -141,6 +141,13 @@ int main(int argc, char* argv[]) optimized = true; #endif + if(!IceUtilInternal::canCaptureStackTrace()) + { + cout << "This IceUtil build cannot capture stack traces" << endl; + return EXIT_SUCCESS; + } + + #if defined(_WIN32) bool binDist = false; vector<wchar_t> buf(256); @@ -220,6 +227,13 @@ int main(int argc, char* argv[]) bool match = true; #endif ifstream ifs(filename.c_str()); + + if(!ifs) + { + cout << "cannot open `" << filename << "`, failed!" << endl; + return EXIT_FAILURE; + } + stringstream sstr; sstr << ifs.rdbuf(); #if defined(__APPLE__) @@ -239,6 +253,15 @@ int main(int argc, char* argv[]) string stack = ex.ice_stackTrace(); // cerr << "\n full stack trace is \n" << stack << endl; +#ifdef __linux + if(optimized && stack.empty()) + { + // Expected for optimized static builds with GCC 5.3+ + cout << "empty... "; + break; + } +#endif + #ifdef __APPLE__ standardizeVersion(stack); if(expected.size() < stack.size()) |