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

@@ -1,12 +1,12 @@
# vim: ft=make ts=4 sw=4 noet cindent
COBJ = Sclient.o network.o ifile.o intcli.o $(FORTIFYOBJ)
COBJ = Sclient.o network.o ifile.o intcli.o $(FORTIFYOBJ)
SOBJ = alias.o anticollider.o arrayutil.o ascon.o asyncprotocol.o asyncqueue.o asynnet.o background.o callback.o \
cell.o chadapter.o choco.o circular.o commandlog.o cone.o confvirtualmot.o \
conman.o costa.o countersec.o danu.o definealias.o devexec.o devser.o diffscan.o d_mod.o \
drive.o d_sign.o dynstring.o emon.o errormsg.o evcontroller.o evdriver.o \
event.o exebuf.o exeman.o fitcenter.o fomerge.o $(FORTIFYOBJ) fourlib.o fourmess.o \
fourtable.o fupa.o genbinprot.o gpibcontroller.o hdbtable.o help.o hipadaba.o \
histdriv.o histmem.o histmemsec.o histregress.o histsim.o hklmot.o hkl.o \
histdriv.o histmem.o histmemsec.o histregress.o histsim.o hklmot.o hkl.o \
hmcontrol.o hmdata.o hmslave.o ifile.o initializer.o integrate.o interface.o \
intserv.o lin2ang.o lld_blob.o lld.o logger.o logreader.o logsetup.o lomax.o \
macro.o maximize.o mccontrol.o mcreader.o mcstascounter.o mcstashm.o \
@@ -20,6 +20,7 @@ SOBJ = alias.o anticollider.o arrayutil.o ascon.o asyncprotocol.o asyncqueue.o a
selvar.o servlog.o sgclib.o sghkl.o sgio.o sicscron.o sicsdata.o sicsexit.o sicsglobal.o sicshdbadapter.o \
sicshdbfactory.o sicshipadaba.o sicslist.o SICSmain.o sicsobj.o sicspoll.o sicsutil.o \
sicvar.o sig_die.o simchop.o simev.o simidx.o simindex.o sinfox.o singlebi.o singlediff.o singlenb.o singlebinb.o singletas.o singlex.o splitter.o s_rnge.o statemon.o \
stack_trace.o \
statistics.o statusfile.o status.o stdscan.o stptok.o stringdict.o strlutil.o strrepl.o \
syncedprot.o synchronize.o tasdrive.o task.o tasscanub.o tasublib.o tasub.o tcldrivable.o \
tclev.o tclintimpl.o telnet.o testprot.o token.o trace.o trigd.o trim.o ubcalc.o \
@@ -30,9 +31,9 @@ SOBJ = alias.o anticollider.o arrayutil.o ascon.o asyncprotocol.o asyncqueue.o a
# them as SECONDARY prevents make from removing them.
.SECONDARY.: ../sicspoll.c ../polldriv.c
MOTOROBJ = motor.o simdriv.o
COUNTEROBJ = countdriv.o simcter.o counter.o
VELOOBJ = velo.o velosim.o
MOTOROBJ = motor.o simdriv.o
COUNTEROBJ = countdriv.o simcter.o counter.o
VELOOBJ = velo.o velosim.o
COREOBJ = $(SOBJ) $(MOTOROBJ) $(COUNTEROBJ) $(VELOOBJ)

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.