-/*
- * $Id: wildfire.c 6962 2009-01-18 19:33:45Z dothebart $
- */
-
/*@{*/
#include "sysdep.h"
#endif
#include "libcitadel.h"
-
+#include "libcitadellocal.h"
ConstStr WF_MsgStrs[] = {
+ {HKEY("LOG")},
{HKEY("INFO")},
{HKEY("WARN")},
{HKEY("ERROR")},
- {HKEY("LOG")},
{HKEY("TRACE")},
{HKEY("EXCEPTION")}
};
pche = strchr(pch, ':');
FlushStrBuf(FileName);
StrBufAppendBufPlain(FileName, pch, pche - pch, 0);
- pche++;
- *FunctionLine = atoi(pche);
-
+ if (pche != NULL)
+ {
+ pche++;
+ *FunctionLine = atoi(pche);
+ }
+ else
+ *FunctionLine = 0;
return 1;
}
long BaseFrames = 0;
StrBuf *FullBinaryName = NULL;
+void WildFireShutdown(void)
+{
+ close(addr2line_write_pipe[0]);
+ close(addr2line_read_pipe[0]);
+
+ FreeStrBuf(&FullBinaryName);
+}
+
void WildFireInitBacktrace(const char *argvNull, int AddBaseFrameSkip)
{
BaseFrames --;
BaseFrames += AddBaseFrameSkip;
strings = backtrace_symbols(stack_frames, size);
- for (i = 0; i < size; i++) {
+ for (i = 1; i < size; i++) {
if (strings != NULL){
ParseBacktrace(strings[i], Function,
FileName,
}
-JsonValue *WildFireException(StrBuf *Message,
- const char *Filename, long FileLen,
+JsonValue *WildFireException(const char *Filename, long FileLen,
long LineNo,
+ StrBuf *Message,
int StackOffset)
{
JsonValue *ExcClass;
const char *Cat;
StrBuf *Header;
+ if (OutBuf == NULL)
+ Header = NewStrBuf();
if (*MsgCount == 0) {
if (OutBuf != NULL) {
StrBufAppendBufPlain(OutBuf,
"http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1\r\n"), 0);
}
else {
- Header = NewStrBuf();
AddHdr("X-Wf-Protocol-1",
"http://meta.wildfirehq.org/Protocol/JsonStream/0.2");
AddHdr("X-Wf-1-Plugin-1",
if (OutBuf == NULL) {
FreeStrBuf(&Header);
}
+ FreeStrBuf(&N);
+ FreeStrBuf(&Buf);
+ FreeStrBuf(&HeaderName);
}