From be2491bc51397a9c45096f49e78662d73d5cc8e4 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Mon, 6 Mar 1995 22:38:42 +0000 Subject: [PATCH] created --- src/libCom/assertUNIX.c | 65 +++++++++++++++++++++++++++++++++++++ src/libCom/assertVX.c | 71 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 src/libCom/assertUNIX.c create mode 100644 src/libCom/assertVX.c diff --git a/src/libCom/assertUNIX.c b/src/libCom/assertUNIX.c new file mode 100644 index 000000000..b975916c9 --- /dev/null +++ b/src/libCom/assertUNIX.c @@ -0,0 +1,65 @@ +/* $Id$ + * assertUNIX.c + * Author: Jeffrey Hill + * Date: 02-27-95 + * + * Experimental Physics and Industrial Control System (EPICS) + * + * Copyright 1991, the Regents of the University of California, + * and the University of Chicago Board of Governors. + * + * This software was produced under U.S. Government contracts: + * (W-7405-ENG-36) at the Los Alamos National Laboratory, + * and (W-31-109-ENG-38) at Argonne National Laboratory. + * + * Initial development by: + * The Controls and Automation Group (AT-8) + * Ground Test Accelerator + * Accelerator Technology Division + * Los Alamos National Laboratory + * + * Co-developed with + * The Controls and Computing Group + * Accelerator Systems Division + * Advanced Photon Source + * Argonne National Laboratory + * + * Modification Log: + * ----------------- + */ + +#include +#include +#include +#include +#include + +#include + + +/* + * epicsAssert () + */ +void epicsAssert (const char *pFile, const unsigned line, const char *pMsg) +{ + epicsPrintf ( +"\n\n\nA call to \"assert (%s)\" failed in %s line %d.\n", pMsg, pFile, line); + + epicsPrintf ( +"The file \"core\" will be created in the current working directory.\n"); + + epicsPrintf ( +"Please save this file and the text of this message in order to assist\n"); + + epicsPrintf ( +"in diagnosing this problem.\n"); + + epicsPrintf ( +"Please contact the author of this software or else send the text of\n"); + + epicsPrintf ( +"this message to \"tech_talk@aps.anl.gov\"\n"); + + abort (); +} + diff --git a/src/libCom/assertVX.c b/src/libCom/assertVX.c new file mode 100644 index 000000000..f688def0b --- /dev/null +++ b/src/libCom/assertVX.c @@ -0,0 +1,71 @@ +/* $Id$ + * assertVX.c + * Author: Jeff Hill + * Date: 02-27-95 + * + * Experimental Physics and Industrial Control System (EPICS) + * + * Copyright 1991, the Regents of the University of California, + * and the University of Chicago Board of Governors. + * + * This software was produced under U.S. Government contracts: + * (W-7405-ENG-36) at the Los Alamos National Laboratory, + * and (W-31-109-ENG-38) at Argonne National Laboratory. + * + * Initial development by: + * The Controls and Automation Group (AT-8) + * Ground Test Accelerator + * Accelerator Technology Division + * Los Alamos National Laboratory + * + * Co-developed with + * The Controls and Computing Group + * Accelerator Systems Division + * Advanced Photon Source + * Argonne National Laboratory + * + * Modification Log: + * ----------------- + *************************************************************************** + */ + +#include +#include +#include +#include +#include + +#include +#include + +#include + + +/* + * epicsAssert () + * + * This forces assert failures into the log file and then + * calls taskSuspend() instead of exit() so that we can debug + * the problem. + */ +void epicsAssert (const char *pFile, const unsigned line, const char *pMsg) +{ + int taskId = taskIdSelf(); + + epicsPrintf ( +"\n\n\n%s: A call to \"assert (%s)\" failed in %s at %d\n", + taskName (taskId), + pMsg, + pFile, + line); + + epicsPrintf ( +"Please send a copy of the output from \"tt (0x%x)\" and a copy of this message\n", + taskId); + + epicsPrintf ( +"to the author or \"tech_talk@aps.anl.gov\"\n"); + + taskSuspend (taskId); +} +