rm -f $(@:%.o=%.d)
ppcoind: $(OBJS:obj/%=obj/nogui/%)
- $(CXX) $(xCXXFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS)
+ $(CXX) $(xCXXFLAGS) -rdynamic -o $@ $^ $(LDFLAGS) $(LIBS)
obj/test/%.o: test/%.cpp
$(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
+// Copyright (c) 2012 The PPCoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_SERIALIZE_H
-
-
+#ifndef THROW_WITH_STACKTRACE
+#define THROW_WITH_STACKTRACE(exception) \
+{ \
+ LogStackTrace(); \
+ throw (exception); \
+}
+void LogStackTrace();
+#endif
//
// Compact size
nSizeRet = xSize;
}
if (nSizeRet > (uint64)MAX_SIZE)
- throw std::ios_base::failure("ReadCompactSize() : size too large");
+ THROW_WITH_STACKTRACE(std::ios_base::failure("ReadCompactSize() : size too large"));
return nSizeRet;
}
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
-// Copyright (c) 2011 The PPCoin developers
+// Copyright (c) 2011-2012 The PPCoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include "headers.h"
#include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>
#include <boost/foreach.hpp>
+#ifndef WIN32
+#include <execinfo.h>
+#endif
+
using namespace std;
using namespace boost;
-
+static FILE* fileout = NULL;
inline int OutputDebugStringF(const char* pszFormat, ...)
{
else
{
// print to debug.log
- static FILE* fileout = NULL;
-
if (!fileout)
{
char pszFile[MAX_PATH+100];
throw;
}
+void LogStackTrace() {
+ printf("\n\n******* exception encountered *******\n");
+ if (fileout)
+ {
+#ifndef WIN32
+ void* pszBuffer[32];
+ size_t size;
+ size = backtrace(pszBuffer, 32);
+ backtrace_symbols_fd(pszBuffer, size, fileno(fileout));
+#endif
+ }
+}
+
void ThreadOneMessageBox(string strMessage)
{
// Skip message boxes if one is already open
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
+// Copyright (c) 2012 The PPCoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_UTIL_H
}
#endif
-
-
+#ifndef THROW_WITH_STACKTRACE
+#define THROW_WITH_STACKTRACE(exception) \
+{ \
+ LogStackTrace(); \
+ throw (exception); \
+}
+void LogStackTrace();
+#endif