mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2024-11-10 07:11:54 +00:00
limited win32 stack-trace size
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@46 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
parent
cdb5b8a5c8
commit
95ac019c00
19 changed files with 65 additions and 66 deletions
|
@ -320,10 +320,7 @@ SingletonPrtViewPluginModule g_PrtViewPluginModule;
|
|||
|
||||
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
||||
{
|
||||
GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
|
||||
GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
|
||||
GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
|
||||
GlobalModuleServer::instance().set(server);
|
||||
initialiseModule(server);
|
||||
|
||||
g_PrtViewPluginModule.selfRegister();
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#define INCLUDED_MODULESYSTEM_H
|
||||
|
||||
#include "generic/static.h"
|
||||
#include "debugging/debugging.h"
|
||||
|
||||
#if defined(WIN32)
|
||||
#define RADIANT_DLLEXPORT __stdcall
|
||||
|
@ -94,6 +95,16 @@ inline ModuleServer& globalModuleServer()
|
|||
}
|
||||
|
||||
|
||||
inline void initialiseModule(ModuleServer& server)
|
||||
{
|
||||
GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
|
||||
GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
|
||||
GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
|
||||
GlobalModuleServer::instance().set(server);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename Type>
|
||||
class Modules
|
||||
{
|
||||
|
|
|
@ -52,10 +52,7 @@ ArchivePakModule g_ArchivePakModule;
|
|||
|
||||
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
||||
{
|
||||
GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
|
||||
GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
|
||||
GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
|
||||
GlobalModuleServer::instance().set(server);
|
||||
initialiseModule(server);
|
||||
|
||||
g_ArchivePakModule.selfRegister();
|
||||
}
|
||||
|
|
|
@ -52,10 +52,7 @@ ArchiveWadModule g_ArchiveWadModule;
|
|||
|
||||
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
||||
{
|
||||
GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
|
||||
GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
|
||||
GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
|
||||
GlobalModuleServer::instance().set(server);
|
||||
initialiseModule(server);
|
||||
|
||||
g_ArchiveWadModule.selfRegister();
|
||||
}
|
||||
|
|
|
@ -75,10 +75,7 @@ ArchivePK4Module g_ArchivePK4Module;
|
|||
|
||||
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
||||
{
|
||||
GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
|
||||
GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
|
||||
GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
|
||||
GlobalModuleServer::instance().set(server);
|
||||
initialiseModule(server);
|
||||
|
||||
g_ArchiveZipModule.selfRegister();
|
||||
g_ArchivePK4Module.selfRegister();
|
||||
|
|
|
@ -151,10 +151,7 @@ EntityDoom3Module g_EntityDoom3Module;
|
|||
|
||||
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
||||
{
|
||||
GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
|
||||
GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
|
||||
GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
|
||||
GlobalModuleServer::instance().set(server);
|
||||
initialiseModule(server);
|
||||
|
||||
g_EntityQ3Module.selfRegister();
|
||||
g_EntityWolfModule.selfRegister();
|
||||
|
|
|
@ -149,10 +149,7 @@ ImageDDSModule g_ImageDDSModule;
|
|||
|
||||
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
||||
{
|
||||
GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
|
||||
GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
|
||||
GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
|
||||
GlobalModuleServer::instance().set(server);
|
||||
initialiseModule(server);
|
||||
|
||||
g_ImageTGAModule.selfRegister();
|
||||
g_ImageJPGModule.selfRegister();
|
||||
|
|
|
@ -105,10 +105,7 @@ ImageSpriteModule g_ImageSpriteModule;
|
|||
|
||||
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
||||
{
|
||||
GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
|
||||
GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
|
||||
GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
|
||||
GlobalModuleServer::instance().set(server);
|
||||
initialiseModule(server);
|
||||
|
||||
g_ImageHLWModule.selfRegister();
|
||||
g_ImageMipModule.selfRegister();
|
||||
|
|
|
@ -198,10 +198,7 @@ ImagePNGModule g_ImagePNGModule;
|
|||
|
||||
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
||||
{
|
||||
GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
|
||||
GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
|
||||
GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
|
||||
GlobalModuleServer::instance().set(server);
|
||||
initialiseModule(server);
|
||||
|
||||
g_ImagePNGModule.selfRegister();
|
||||
}
|
||||
|
|
|
@ -106,10 +106,7 @@ ImageM32Module g_ImageM32Module;
|
|||
|
||||
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
||||
{
|
||||
GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
|
||||
GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
|
||||
GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
|
||||
GlobalModuleServer::instance().set(server);
|
||||
initialiseModule(server);
|
||||
|
||||
g_ImageWalModule.selfRegister();
|
||||
g_ImageM8Module.selfRegister();
|
||||
|
|
|
@ -646,10 +646,7 @@ MapVMFModule g_MapVMFModule;
|
|||
|
||||
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
||||
{
|
||||
GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
|
||||
GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
|
||||
GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
|
||||
GlobalModuleServer::instance().set(server);
|
||||
initialiseModule(server);
|
||||
|
||||
g_MapDoom3Module.selfRegister();
|
||||
g_MapQuake4Module.selfRegister();
|
||||
|
|
|
@ -84,10 +84,7 @@ MapXMLModule g_MapXMLModule;
|
|||
|
||||
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
||||
{
|
||||
GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
|
||||
GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
|
||||
GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
|
||||
GlobalModuleServer::instance().set(server);
|
||||
initialiseModule(server);
|
||||
|
||||
g_MapXMLModule.selfRegister();
|
||||
}
|
||||
|
|
|
@ -236,10 +236,7 @@ ModelMD5Module g_ModelMD5Module;
|
|||
|
||||
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
||||
{
|
||||
GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
|
||||
GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
|
||||
GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
|
||||
GlobalModuleServer::instance().set(server);
|
||||
initialiseModule(server);
|
||||
|
||||
g_ModelMD3Module.selfRegister();
|
||||
g_ModelMD2Module.selfRegister();
|
||||
|
|
|
@ -169,10 +169,7 @@ PicoModelModules g_PicoModelModules;
|
|||
|
||||
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
||||
{
|
||||
GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
|
||||
GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
|
||||
GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
|
||||
GlobalModuleServer::instance().set(server);
|
||||
initialiseModule(server);
|
||||
|
||||
pico_initialise();
|
||||
|
||||
|
|
|
@ -89,10 +89,7 @@ SingletonSamplePluginModule g_SamplePluginModule;
|
|||
|
||||
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
||||
{
|
||||
GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
|
||||
GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
|
||||
GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
|
||||
GlobalModuleServer::instance().set(server);
|
||||
initialiseModule(server);
|
||||
|
||||
g_SamplePluginModule.selfRegister();
|
||||
}
|
||||
|
|
|
@ -149,10 +149,7 @@ ShadersQuake4Module g_ShadersQuake4Module;
|
|||
|
||||
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
||||
{
|
||||
GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
|
||||
GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
|
||||
GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
|
||||
GlobalModuleServer::instance().set(server);
|
||||
initialiseModule(server);
|
||||
|
||||
g_ShadersQ3Module.selfRegister();
|
||||
g_ShadersDoom3Module.selfRegister();
|
||||
|
|
|
@ -79,10 +79,7 @@ ArchiveModules& FileSystemQ3API_getArchiveModules()
|
|||
|
||||
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
||||
{
|
||||
GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
|
||||
GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
|
||||
GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
|
||||
GlobalModuleServer::instance().set(server);
|
||||
initialiseModule(server);
|
||||
|
||||
g_FileSystemQ3Module.selfRegister();
|
||||
}
|
||||
|
|
|
@ -155,7 +155,7 @@ public:
|
|||
|
||||
std::size_t Sys_Print(int level, const char* buf, std::size_t length)
|
||||
{
|
||||
bool contains_newline = strchr(buf, '\n') != 0;
|
||||
bool contains_newline = std::find(buf, buf+length, '\n') != buf+length;
|
||||
|
||||
if(level == SYS_ERR)
|
||||
{
|
||||
|
|
|
@ -232,6 +232,41 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class LineLimitedTextOutputStream : public TextOutputStream
|
||||
{
|
||||
TextOutputStream& outputStream;
|
||||
std::size_t count;
|
||||
public:
|
||||
LineLimitedTextOutputStream(TextOutputStream& outputStream, std::size_t count)
|
||||
: outputStream(outputStream), count(count)
|
||||
{
|
||||
}
|
||||
std::size_t write(const char* buffer, std::size_t length)
|
||||
{
|
||||
if(count != 0)
|
||||
{
|
||||
const char* p = buffer;
|
||||
const char* end = buffer+length;
|
||||
for(;;)
|
||||
{
|
||||
p = std::find(p, end, '\n');
|
||||
if(p == end)
|
||||
{
|
||||
break;
|
||||
}
|
||||
++p;
|
||||
if(--count == 0)
|
||||
{
|
||||
length = p - buffer;
|
||||
break;
|
||||
}
|
||||
}
|
||||
outputStream.write(buffer, length);
|
||||
}
|
||||
return length;
|
||||
}
|
||||
};
|
||||
|
||||
class PopupDebugMessageHandler : public DebugMessageHandler
|
||||
{
|
||||
StringOutputStream m_buffer;
|
||||
|
@ -248,7 +283,8 @@ public:
|
|||
bool handleMessage()
|
||||
{
|
||||
getOutputStream() << "----------------\n";
|
||||
write_stack_trace(getOutputStream());
|
||||
LineLimitedTextOutputStream outputStream(getOutputStream(), 24);
|
||||
write_stack_trace(outputStream);
|
||||
getOutputStream() << "----------------\n";
|
||||
if(!m_lock.locked())
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue