- when disabling backtrace ensure console output only shows direct errors without backtrace
This commit is contained in:
parent
3ec510fa17
commit
a8af70cee1
|
@ -2986,6 +2986,7 @@ int glestMain(int argc, char** argv) {
|
|||
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_DISABLE_BACKTRACE]) == true) {
|
||||
disableBacktrace = true;
|
||||
}
|
||||
PlatformExceptionHandler::disableBacktrace= disableBacktrace;
|
||||
|
||||
// UErrorCode status = U_ZERO_ERROR;
|
||||
// u_init(&status);
|
||||
|
|
|
@ -41,6 +41,7 @@ public:
|
|||
class PlatformExceptionHandler {
|
||||
public:
|
||||
static string application_binary;
|
||||
static bool disableBacktrace;
|
||||
static string getStackTrace();
|
||||
|
||||
virtual ~PlatformExceptionHandler() {}
|
||||
|
|
|
@ -32,6 +32,7 @@ using namespace std;
|
|||
namespace Shared{ namespace Platform{
|
||||
|
||||
string PlatformExceptionHandler::application_binary="";
|
||||
bool PlatformExceptionHandler::disableBacktrace = false;
|
||||
|
||||
// This was the simplest, most portable solution i could find in 5 mins for linux
|
||||
int MessageBox(int handle, const char *msg, const char *title, int buttons) {
|
||||
|
@ -161,11 +162,16 @@ static int getFileAndLine(char *function, void *address, char *file, size_t flen
|
|||
#endif
|
||||
|
||||
string PlatformExceptionHandler::getStackTrace() {
|
||||
string errMsg = "";
|
||||
string errMsg = "\nStack Trace:\n";
|
||||
if(PlatformExceptionHandler::disableBacktrace == true) {
|
||||
errMsg += "disabled...";
|
||||
return errMsg;
|
||||
}
|
||||
|
||||
//#if defined(__GNUC__) && !defined(__MINGW32__) && !defined(__FreeBSD__) && !defined(BSD)
|
||||
#if defined(HAS_GCC_BACKTRACE)
|
||||
// if(disableBacktrace == false && sdl_quitCalled == false) {
|
||||
errMsg = "\nStack Trace:\n";
|
||||
//errMsg = "\nStack Trace:\n";
|
||||
//errMsg += "To find line #'s use:\n";
|
||||
//errMsg += "readelf --debug-dump=decodedline %s | egrep 0xaddress-of-stack\n";
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ namespace Shared { namespace Platform {
|
|||
// class PlatformExceptionHandler
|
||||
// =====================================================
|
||||
string PlatformExceptionHandler::application_binary="";
|
||||
bool PlatformExceptionHandler::disableBacktrace = false;
|
||||
PlatformExceptionHandler *PlatformExceptionHandler::thisPointer= NULL;
|
||||
|
||||
// Constructs object and convert lpaszString to Unicode
|
||||
|
@ -152,7 +153,10 @@ void PlatformExceptionHandler::install(string dumpFileName){
|
|||
|
||||
string PlatformExceptionHandler::getStackTrace() {
|
||||
string result = "\nStack Trace:\n";
|
||||
|
||||
if(PlatformExceptionHandler::disableBacktrace == true) {
|
||||
result += "disabled...";
|
||||
return result;
|
||||
}
|
||||
#ifndef __MINGW32__
|
||||
/*
|
||||
unsigned int i;
|
||||
|
|
Loading…
Reference in New Issue
Block a user