Create a new function, addDumpInfo(), to be used to add custom information to the crash dump report file.
Currently, we query openAL & openGL vendor/version info. This should give us more descriptive crash reports on the user's hardware. git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7738 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
e53a25e859
commit
1ccb1487de
|
@ -51,6 +51,9 @@ static const std::size_t max_debug_messages = 20;
|
||||||
static char* dbgHeader = NULL;
|
static char* dbgHeader = NULL;
|
||||||
static std::deque<std::vector<char> > dbgMessages;
|
static std::deque<std::vector<char> > dbgMessages;
|
||||||
|
|
||||||
|
// used to add custom info to the crash log
|
||||||
|
static std::ostringstream miscData;
|
||||||
|
|
||||||
static void dumpstr(const DumpFileHandle file, const char * const str, std::size_t const size)
|
static void dumpstr(const DumpFileHandle file, const char * const str, std::size_t const size)
|
||||||
{
|
{
|
||||||
#if defined(WZ_OS_WIN)
|
#if defined(WZ_OS_WIN)
|
||||||
|
@ -126,6 +129,13 @@ void dbgDumpHeader(DumpFileHandle file)
|
||||||
if (dbgHeader)
|
if (dbgHeader)
|
||||||
{
|
{
|
||||||
dumpstr(file, dbgHeader);
|
dumpstr(file, dbgHeader);
|
||||||
|
// Now get any other data that we need to include in bug report
|
||||||
|
dumpstr(file, "Misc Data:");
|
||||||
|
dumpEOL(file);
|
||||||
|
dumpstr(file, miscData.str().c_str());
|
||||||
|
dumpEOL(file);
|
||||||
|
dumpstr(file, "===============");
|
||||||
|
dumpEOL(file);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -307,6 +317,7 @@ static void createHeader(int const argc, char* argv[])
|
||||||
PHYSFS_getLinkedVersion(&physfs_version);
|
PHYSFS_getLinkedVersion(&physfs_version);
|
||||||
os << "Running with PhysicsFS version: " << physfs_version << endl
|
os << "Running with PhysicsFS version: " << physfs_version << endl
|
||||||
<< endl;
|
<< endl;
|
||||||
|
os << "===============" << endl;
|
||||||
|
|
||||||
dbgHeader = strdup(os.str().c_str());
|
dbgHeader = strdup(os.str().c_str());
|
||||||
if (dbgHeader == NULL)
|
if (dbgHeader == NULL)
|
||||||
|
@ -317,6 +328,11 @@ static void createHeader(int const argc, char* argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void addDumpInfo( char *inbuffer)
|
||||||
|
{
|
||||||
|
miscData << std::string(inbuffer) << endl;
|
||||||
|
}
|
||||||
|
|
||||||
void dbgDumpInit(int argc, char* argv[])
|
void dbgDumpInit(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
debug_register_callback(&debug_exceptionhandler_data, NULL, NULL, NULL );
|
debug_register_callback(&debug_exceptionhandler_data, NULL, NULL, NULL );
|
||||||
|
|
|
@ -45,6 +45,8 @@ extern void dbgDumpLog(DumpFileHandle file);
|
||||||
|
|
||||||
extern void dbgDumpInit(int argc, char* argv[]);
|
extern void dbgDumpInit(int argc, char* argv[]);
|
||||||
|
|
||||||
|
extern void addDumpInfo(char *inbuffer);
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#include "lib/ivis_opengl/GLee.h"
|
#include "lib/ivis_opengl/GLee.h"
|
||||||
#include "lib/framework/frame.h"
|
#include "lib/framework/frame.h"
|
||||||
|
#include "lib/exceptionhandler/dumpinfo.h"
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <physfs.h>
|
#include <physfs.h>
|
||||||
#include <png.h>
|
#include <png.h>
|
||||||
|
@ -36,6 +36,7 @@
|
||||||
#include "lib/framework/frameint.h"
|
#include "lib/framework/frameint.h"
|
||||||
#include "lib/ivis_common/piestate.h"
|
#include "lib/ivis_common/piestate.h"
|
||||||
#include "lib/ivis_common/pieblitfunc.h"
|
#include "lib/ivis_common/pieblitfunc.h"
|
||||||
|
|
||||||
#if defined(WZ_OS_MAC)
|
#if defined(WZ_OS_MAC)
|
||||||
#include <OpenGL/glu.h>
|
#include <OpenGL/glu.h>
|
||||||
#else
|
#else
|
||||||
|
@ -171,27 +172,37 @@ BOOL screenInitialise(
|
||||||
{
|
{
|
||||||
debug( LOG_ERROR, "OpenGL initialization did not give double buffering!" );
|
debug( LOG_ERROR, "OpenGL initialization did not give double buffering!" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
char buf[256];
|
||||||
|
|
||||||
/* Dump information about OpenGL implementation to the console */
|
// Copy this info to the crash handler report info
|
||||||
debug(LOG_3D, "OpenGL Vendor : %s", glGetString(GL_VENDOR));
|
ssprintf(buf, "OpenGL Vendor : %s", glGetString(GL_VENDOR));
|
||||||
debug(LOG_3D, "OpenGL Renderer : %s", glGetString(GL_RENDERER));
|
addDumpInfo(buf);
|
||||||
debug(LOG_3D, "OpenGL Version : %s", glGetString(GL_VERSION));
|
ssprintf(buf, "OpenGL Renderer : %s", glGetString(GL_RENDERER));
|
||||||
debug(LOG_3D, "OpenGL Extensions : %s", glGetString(GL_EXTENSIONS)); // FIXME This is too much for MAX_LEN_LOG_LINE
|
addDumpInfo(buf);
|
||||||
debug(LOG_3D, "Supported OpenGL extensions:");
|
ssprintf(buf, "OpenGL Version : %s", glGetString(GL_VERSION));
|
||||||
debug(LOG_3D, " * OpenGL 1.2 %s supported!", GLEE_VERSION_1_2 ? "is" : "is NOT");
|
addDumpInfo(buf);
|
||||||
debug(LOG_3D, " * OpenGL 1.3 %s supported!", GLEE_VERSION_1_3 ? "is" : "is NOT");
|
/* Dump information about OpenGL implementation to the console */
|
||||||
debug(LOG_3D, " * OpenGL 1.4 %s supported!", GLEE_VERSION_1_4 ? "is" : "is NOT");
|
debug(LOG_3D, "OpenGL Vendor : %s", glGetString(GL_VENDOR));
|
||||||
debug(LOG_3D, " * OpenGL 1.5 %s supported!", GLEE_VERSION_1_5 ? "is" : "is NOT");
|
debug(LOG_3D, "OpenGL Renderer : %s", glGetString(GL_RENDERER));
|
||||||
debug(LOG_3D, " * OpenGL 2.0 %s supported!", GLEE_VERSION_2_0 ? "is" : "is NOT");
|
debug(LOG_3D, "OpenGL Version : %s", glGetString(GL_VERSION));
|
||||||
debug(LOG_3D, " * OpenGL 2.1 %s supported!", GLEE_VERSION_2_1 ? "is" : "is NOT");
|
debug(LOG_3D, "OpenGL Extensions : %s", glGetString(GL_EXTENSIONS)); // FIXME This is too much for MAX_LEN_LOG_LINE
|
||||||
debug(LOG_3D, " * OpenGL 3.0 %s supported!", GLEE_VERSION_3_0 ? "is" : "is NOT");
|
debug(LOG_3D, "Supported OpenGL extensions:");
|
||||||
debug(LOG_3D, " * Texture compression %s supported.", GLEE_ARB_texture_compression ? "is" : "is NOT");
|
debug(LOG_3D, " * OpenGL 1.2 %s supported!", GLEE_VERSION_1_2 ? "is" : "is NOT");
|
||||||
debug(LOG_3D, " * Two side stencil %s supported.", GLEE_EXT_stencil_two_side ? "is" : "is NOT");
|
debug(LOG_3D, " * OpenGL 1.3 %s supported!", GLEE_VERSION_1_3 ? "is" : "is NOT");
|
||||||
debug(LOG_3D, " * Stencil wrap %s supported.", GLEE_EXT_stencil_wrap ? "is" : "is NOT");
|
debug(LOG_3D, " * OpenGL 1.4 %s supported!", GLEE_VERSION_1_4 ? "is" : "is NOT");
|
||||||
debug(LOG_3D, " * Anisotropic filtering %s supported.", GLEE_EXT_texture_filter_anisotropic ? "is" : "is NOT");
|
debug(LOG_3D, " * OpenGL 1.5 %s supported!", GLEE_VERSION_1_5 ? "is" : "is NOT");
|
||||||
debug(LOG_3D, " * Rectangular texture %s supported.", GLEE_ARB_texture_rectangle ? "is" : "is NOT");
|
debug(LOG_3D, " * OpenGL 2.0 %s supported!", GLEE_VERSION_2_0 ? "is" : "is NOT");
|
||||||
debug(LOG_3D, " * FrameBuffer Object (FBO) %s supported.", GLEE_EXT_framebuffer_object ? "is" : "is NOT");
|
debug(LOG_3D, " * OpenGL 2.1 %s supported!", GLEE_VERSION_2_1 ? "is" : "is NOT");
|
||||||
|
debug(LOG_3D, " * OpenGL 3.0 %s supported!", GLEE_VERSION_3_0 ? "is" : "is NOT");
|
||||||
|
debug(LOG_3D, " * Texture compression %s supported.", GLEE_ARB_texture_compression ? "is" : "is NOT");
|
||||||
|
debug(LOG_3D, " * Two side stencil %s supported.", GLEE_EXT_stencil_two_side ? "is" : "is NOT");
|
||||||
|
debug(LOG_3D, " * Stencil wrap %s supported.", GLEE_EXT_stencil_wrap ? "is" : "is NOT");
|
||||||
|
debug(LOG_3D, " * Anisotropic filtering %s supported.", GLEE_EXT_texture_filter_anisotropic ? "is" : "is NOT");
|
||||||
|
debug(LOG_3D, " * Rectangular texture %s supported.", GLEE_ARB_texture_rectangle ? "is" : "is NOT");
|
||||||
|
debug(LOG_3D, " * FrameBuffer Object (FBO) %s supported.", GLEE_EXT_framebuffer_object ? "is" : "is NOT");
|
||||||
|
}
|
||||||
// Make OpenGL's VBO functions available under the core names for
|
// Make OpenGL's VBO functions available under the core names for
|
||||||
// implementations that have them only as extensions, namely Mesa.
|
// implementations that have them only as extensions, namely Mesa.
|
||||||
if (!strncmp((const char *)glGetString(GL_RENDERER), "Mesa", 4))
|
if (!strncmp((const char *)glGetString(GL_RENDERER), "Mesa", 4))
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "lib/framework/frame.h"
|
#include "lib/framework/frame.h"
|
||||||
#include "lib/framework/math_ext.h"
|
#include "lib/framework/math_ext.h"
|
||||||
#include "lib/framework/frameresource.h"
|
#include "lib/framework/frameresource.h"
|
||||||
|
#include "lib/exceptionhandler/dumpinfo.h"
|
||||||
|
|
||||||
#ifndef WZ_NOSOUND
|
#ifndef WZ_NOSOUND
|
||||||
# ifdef WZ_OS_MAC
|
# ifdef WZ_OS_MAC
|
||||||
|
@ -122,6 +123,7 @@ static void sound_RemoveSample(SAMPLE_LIST* previous, SAMPLE_LIST* to_remove)
|
||||||
static void PrintOpenALVersion(code_part part)
|
static void PrintOpenALVersion(code_part part)
|
||||||
{
|
{
|
||||||
const ALchar* pDeviceNames = NULL;
|
const ALchar* pDeviceNames = NULL;
|
||||||
|
char buf[256];
|
||||||
|
|
||||||
debug(part, "OpenAL Vendor: %s", alGetString(AL_VENDOR));
|
debug(part, "OpenAL Vendor: %s", alGetString(AL_VENDOR));
|
||||||
debug(part, "OpenAL Version: %s", alGetString(AL_VERSION));
|
debug(part, "OpenAL Version: %s", alGetString(AL_VERSION));
|
||||||
|
@ -139,6 +141,14 @@ static void PrintOpenALVersion(code_part part)
|
||||||
debug(part, "available openAL device(s) are: %s", pDeviceNames);
|
debug(part, "available openAL device(s) are: %s", pDeviceNames);
|
||||||
pDeviceNames += strlen(pDeviceNames) + 1;
|
pDeviceNames += strlen(pDeviceNames) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Copy this info to the crash handler report info
|
||||||
|
ssprintf(buf,"OpenAL Vendor: %s", alGetString(AL_VENDOR));
|
||||||
|
addDumpInfo(buf);
|
||||||
|
ssprintf(buf,"OpenAL Version: %s", alGetString(AL_VERSION));
|
||||||
|
addDumpInfo(buf);
|
||||||
|
ssprintf(buf,"OpenAL Renderer: %s", alGetString(AL_RENDERER));
|
||||||
|
addDumpInfo(buf);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue