summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2009-09-09 15:12:00 -0230
committerDwayne Boone <dwayne@zeroc.com>2009-09-09 15:12:00 -0230
commite71a65a56ab346e321c4294bccf47d7ef3107115 (patch)
treef41bb2d0676438becc4bab0a0e3612a857a50604 /cpp/src
parenthttp://bugzilla/bugzilla/show_bug.cgi?id=2839 (diff)
downloadice-e71a65a56ab346e321c4294bccf47d7ef3107115.tar.bz2
ice-e71a65a56ab346e321c4294bccf47d7ef3107115.tar.xz
ice-e71a65a56ab346e321c4294bccf47d7ef3107115.zip
Bug 2664 - do not calculate stack traces
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/Instance.cpp4
-rw-r--r--cpp/src/Ice/LoggerUtil.cpp6
-rw-r--r--cpp/src/IceUtil/Exception.cpp12
3 files changed, 17 insertions, 5 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index 3bd69893744..790c34cead1 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -64,7 +64,7 @@ extern bool ICE_DECLSPEC_IMPORT nullHandleAbort;
}
-namespace IceInternal
+namespace IceUtilInternal
{
extern bool printStackTraces;
@@ -838,7 +838,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
if(_initData.properties->getPropertyAsIntWithDefault("Ice.PrintStackTraces", 1) > 0)
#endif
{
- printStackTraces = true;
+ IceUtilInternal::printStackTraces = true;
}
#ifndef _WIN32
diff --git a/cpp/src/Ice/LoggerUtil.cpp b/cpp/src/Ice/LoggerUtil.cpp
index 2b92afe037a..2a98d72fa3f 100644
--- a/cpp/src/Ice/LoggerUtil.cpp
+++ b/cpp/src/Ice/LoggerUtil.cpp
@@ -16,10 +16,10 @@
using namespace std;
-namespace IceInternal
+namespace IceUtilInternal
{
-bool printStackTraces = false;
+extern bool printStackTraces;
}
@@ -40,7 +40,7 @@ Ice::LoggerOutputBase&
Ice::operator<<(Ice::LoggerOutputBase& out, const std::exception& ex)
{
#ifdef __GNUC__
- if(IceInternal::printStackTraces)
+ if(IceUtilInternal::printStackTraces)
{
const ::IceUtil::Exception* exception = dynamic_cast<const ::IceUtil::Exception*>(&ex);
if(exception)
diff --git a/cpp/src/IceUtil/Exception.cpp b/cpp/src/IceUtil/Exception.cpp
index 3ada15e03d7..a2f973fc979 100644
--- a/cpp/src/IceUtil/Exception.cpp
+++ b/cpp/src/IceUtil/Exception.cpp
@@ -21,6 +21,13 @@
using namespace std;
+namespace IceUtilInternal
+{
+
+bool printStackTraces = false;
+
+}
+
namespace
{
@@ -62,6 +69,11 @@ getStackTrace()
{
string stackTrace;
+ if(!IceUtilInternal::printStackTraces)
+ {
+ return stackTrace;
+ }
+
const size_t maxDepth = 100;
void *stackAddrs[maxDepth];