From c39f39cb939ff9d4e60c6f265275d2ec6696c862 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 30 Jun 2025 16:03:39 -0700 Subject: [PATCH] improve message for missing INAM/SNAM Include the requested function name --- modules/database/src/std/rec/aSubRecord.c | 9 +++++---- modules/database/src/std/rec/subRecord.c | 10 ++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/modules/database/src/std/rec/aSubRecord.c b/modules/database/src/std/rec/aSubRecord.c index c6ba13038..42bbcff55 100644 --- a/modules/database/src/std/rec/aSubRecord.c +++ b/modules/database/src/std/rec/aSubRecord.c @@ -21,6 +21,7 @@ #include "alarm.h" #include "cantProceed.h" +#include "epicsStdio.h" #include "dbDefs.h" #include "dbEvent.h" #include "dbAccess.h" @@ -141,8 +142,8 @@ static long init_record(struct dbCommon *pcommon, int pass) if (pfunc) { pfunc(prec); } else { - recGblRecordError(S_db_BadSub, (void *)prec, - "aSubRecord::init_record - INAM subr not found"); + fprintf(stderr, "%s.INAM " ERL_ERROR " function '%s' not found\n", + prec->name, prec->inam); return S_db_BadSub; } } @@ -153,8 +154,8 @@ static long init_record(struct dbCommon *pcommon, int pass) if (pfunc) prec->sadr = pfunc; else { - recGblRecordError(S_db_BadSub, (void *)prec, - "aSubRecord::init_record - SNAM subr not found"); + fprintf(stderr, "%s.SNAM " ERL_ERROR " function '%s' not found\n", + prec->name, prec->snam); return S_db_BadSub; } } diff --git a/modules/database/src/std/rec/subRecord.c b/modules/database/src/std/rec/subRecord.c index 1ef3af3de..be274d18f 100644 --- a/modules/database/src/std/rec/subRecord.c +++ b/modules/database/src/std/rec/subRecord.c @@ -108,7 +108,8 @@ static long init_record(struct dbCommon *pcommon, int pass) /* convert the initialization subroutine name */ psubroutine = (SUBFUNCPTR)registryFunctionFind(prec->inam); if (psubroutine == 0) { - recGblRecordError(S_db_BadSub, (void *)prec, "Init subroutine (INAM)"); + fprintf(stderr, "%s.INAM " ERL_ERROR " function '%s' not found\n", + prec->name, prec->inam); return S_db_BadSub; } /* invoke the initialization subroutine */ @@ -122,7 +123,8 @@ static long init_record(struct dbCommon *pcommon, int pass) } prec->sadr = (SUBFUNCPTR)registryFunctionFind(prec->snam); if (prec->sadr == NULL) { - recGblRecordError(S_db_BadSub, (void *)prec, "Proc subroutine (SNAM)"); + fprintf(stderr, "%s.SNAM " ERL_ERROR " function '%s' not found\n", + prec->name, prec->snam); return S_db_BadSub; } prec->mlst = prec->val; @@ -186,8 +188,8 @@ static long special(DBADDR *paddr, int after) prec->sadr = (SUBFUNCPTR)registryFunctionFind(prec->snam); if (prec->sadr) return 0; - recGblRecordError(S_db_BadSub, (void *)prec, - "subRecord(special) registryFunctionFind failed"); + fprintf(stderr, "%s " ERL_ERROR " subRecord::special - SNAM = '%s' not found\n", + prec->name, prec->snam); return S_db_BadSub; }