Add capability of creating a stack trace and/or a core dump on the fly.

This commit is contained in:
Douglas Clowes
2014-10-15 12:18:38 +11:00
parent 61b1dcb4a5
commit 539ea4d9da
4 changed files with 337 additions and 7 deletions

View File

@@ -64,6 +64,7 @@
/*@observer@*//*@null@*/ pCounterDriver CreateMonCounter(/*@observer@*/SConnection *pCon, /*@observer@*/char *name, char *params);
extern void AddGalilProtocoll();
extern void AddModbusProtocoll();
extern void AddOxfordProtocoll();
@@ -78,6 +79,7 @@ extern void AddTCPMBProtocol ();
extern void AddLFGenProtocol();
extern void AddSCAQAProtocol();
extern int ANSTO_MakeHistMemory(SConnection *pCon, SicsInterp *pSics, void *pData, int argc, char *argv[]);
extern int Ansto_Stack_Trace(SConnection *pCon, SicsInterp *pSics, void *pData, int argc, char *argv[]);
extern int testLogCmd(SConnection *pCon, SicsInterp *pSics, void *pData, int argc, char *argv[]);
extern pCounterDriver CreateCam(SConnection *pCon, char *name, char *asynq);
@@ -307,12 +309,12 @@ int testLogCmd(SConnection *pCon, SicsInterp *pInter, void *pData,
SICSLogWrite("Multiline:\nLine 1\r\nLine 2\r\nLine 3\r\n", eLog);
memset(lbuf, 0, sizeof(lbuf));
memset(sbuf, ' ', sizeof(sbuf));
SICSLogPrintf(eLog, "Hexlog %d all zero bytes", sizeof(lbuf));
SICSLogPrintf(eLog, "Hexlog %d all zero bytes", (int) sizeof(lbuf));
SICSLogWriteHex(lbuf, sizeof(lbuf), eLog);
for (i = 0; i <= 128; ++i)
sbuf[i] = sbuf[sizeof(sbuf) - 1 - i] = i;
sbuf[sizeof(sbuf) / 2] = '!';
SICSLogPrintf(eLog, "Hexlog %d mid space bytes", sizeof(sbuf));
SICSLogPrintf(eLog, "Hexlog %d mid space bytes", (int) sizeof(sbuf));
SICSLogWriteHex(sbuf, sizeof(sbuf), eLog);
for (i = 0; i < 1000; ++i)
sbuf[i] = ' ' + (i % 96);
@@ -404,6 +406,7 @@ static void AddCommands(SicsInterp *pInter)
AddCommand(pInter, "FileEvalGlob", MacroFileEvalGlob, NULL, NULL);
AddCommand(pInter, "Valgrind", Ansto_Valgrind, NULL, NULL);
AddCommand(pInter, "anstocapture", Ansto_Capture, NULL, NULL);
AddCommand(pInter, "stack_trace", Ansto_Stack_Trace, NULL, NULL);
/*
* Tcl 8.5 has implemented the clock command in tcl rather then C.