Merge ~bhill/epics-base:pv-name-in-ca-error-msgs into ~epics-core/epics-base/+git/epics-base:3.15

Proposed by Bruce Hill
Status: Merged
Approved by: Andrew Johnson
Approved revision: 05a3699b49642d43655022f365b7bb8c7ed4460b
Merged at revision: 06ad4a0d70142a1396a9ddea1e0057b8bb6d5ccd
Proposed branch: ~bhill/epics-base:pv-name-in-ca-error-msgs
Merge into: ~epics-core/epics-base/+git/epics-base:3.15
Diff against target: 99 lines (+18/-14)
1 file modified
src/ca/legacy/pcas/generic/casPVI.cc (+18/-14)
Reviewer Review Type Date Requested Status
Andrew Johnson Approve
Review via email: mp+341273@code.launchpad.net

Description of the change

Updated all errMessage to casErrMessage and retargeted to 3.15

To post a comment you must log in.
Revision history for this message
Ralph Lange (ralph-lange) wrote :

Line 174 ff. and 212 ff. use errPrintf() to add the PV name to the output. These could be replaced by using the new macro for consistency.

Revision history for this message
Andrew Johnson (anj) wrote :

Core Meeting: Seems good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/src/ca/legacy/pcas/generic/casPVI.cc b/src/ca/legacy/pcas/generic/casPVI.cc
index 50e5d27..48692b9 100644
--- a/src/ca/legacy/pcas/generic/casPVI.cc
+++ b/src/ca/legacy/pcas/generic/casPVI.cc
@@ -26,6 +26,11 @@
26#include "casAsyncIOI.h"26#include "casAsyncIOI.h"
27#include "casMonitor.h"27#include "casMonitor.h"
2828
29
30// Use casErrMessage instead of errMessage to show PV name
31#define casErrMessage(S, PM) \
32 errPrintf(S, __FILE__, __LINE__, ", %s, %s", getName(), PM)
33
29casPVI::casPVI ( casPV & intf ) : 34casPVI::casPVI ( casPV & intf ) :
30 pCAS ( NULL ), pPV ( & intf ), nMonAttached ( 0u ), 35 pCAS ( NULL ), pPV ( & intf ), nMonAttached ( 0u ),
31 nIOAttached ( 0u ), deletePending ( false ) {}36 nIOAttached ( 0u ), deletePending ( false ) {}
@@ -146,7 +151,7 @@ caStatus casPVI::updateEnumStringTable ( casCtx & ctxIn )
146 // gddArray(int app, aitEnum prim, int dimen, ...);151 // gddArray(int app, aitEnum prim, int dimen, ...);
147 gdd * pTmp = new gddScalar ( gddAppType_enums );152 gdd * pTmp = new gddScalar ( gddAppType_enums );
148 if ( pTmp == NULL ) {153 if ( pTmp == NULL ) {
149 errMessage ( S_cas_noMemory, 154 casErrMessage ( S_cas_noMemory,
150 "unable to create gdd for read of application type \"enums\" string"155 "unable to create gdd for read of application type \"enums\" string"
151 " conversion table for enumerated PV" );156 " conversion table for enumerated PV" );
152 return S_cas_noMemory;157 return S_cas_noMemory;
@@ -156,8 +161,8 @@ caStatus casPVI::updateEnumStringTable ( casCtx & ctxIn )
156 gddAppType_enums, MAX_ENUM_STATES );161 gddAppType_enums, MAX_ENUM_STATES );
157 if ( status != S_cas_success ) {162 if ( status != S_cas_success ) {
158 pTmp->unreference ();163 pTmp->unreference ();
159 errMessage ( status, 164 casErrMessage ( status,
160 "unable to to config gdd for read of application type \"enums\" string"165 "unable to config gdd for read of application type \"enums\" string"
161 " conversion table for enumerated PV");166 " conversion table for enumerated PV");
162 return status;167 return status;
163 }168 }
@@ -187,9 +192,9 @@ void casPVI::updateEnumStringTableAsyncCompletion ( const gdd & resp )
187 epicsGuard < epicsMutex > guard ( this->mutex );192 epicsGuard < epicsMutex > guard ( this->mutex );
188 193
189 if ( resp.isContainer() ) {194 if ( resp.isContainer() ) {
190 errMessage ( S_cas_badType, 195 casErrMessage ( S_cas_badType,
191 "application type \"enums\" string conversion table for"196 "Invalid \"enums\" string conversion table for"
192 " enumerated PV was a container (expected vector of strings)" );197 " enumerated PV (container instead of vector of strings)" );
193 return;198 return;
194 }199 }
195 200
@@ -197,14 +202,14 @@ void casPVI::updateEnumStringTableAsyncCompletion ( const gdd & resp )
197 if ( resp.primitiveType() == aitEnumString ) {202 if ( resp.primitiveType() == aitEnumString ) {
198 aitString *pStr = (aitString *) resp.dataVoid ();203 aitString *pStr = (aitString *) resp.dataVoid ();
199 if ( ! this->enumStrTbl.setString ( 0, pStr->string() ) ) {204 if ( ! this->enumStrTbl.setString ( 0, pStr->string() ) ) {
200 errMessage ( S_cas_noMemory, 205 casErrMessage ( S_cas_noMemory,
201 "no memory to set enumerated PV string cache" );206 "no memory to set enumerated PV string cache" );
202 }207 }
203 }208 }
204 else if ( resp.primitiveType() == aitEnumFixedString ) {209 else if ( resp.primitiveType() == aitEnumFixedString ) {
205 aitFixedString *pStr = (aitFixedString *) resp.dataVoid ();210 aitFixedString *pStr = (aitFixedString *) resp.dataVoid ();
206 if ( ! this->enumStrTbl.setString ( 0, pStr->fixed_string ) ) {211 if ( ! this->enumStrTbl.setString ( 0, pStr->fixed_string ) ) {
207 errMessage ( S_cas_noMemory, 212 casErrMessage ( S_cas_noMemory,
208 "no memory to set enumerated PV string cache" );213 "no memory to set enumerated PV string cache" );
209 }214 }
210 }215 }
@@ -232,7 +237,7 @@ void casPVI::updateEnumStringTableAsyncCompletion ( const gdd & resp )
232 aitString *pStr = (aitString *) resp.dataVoid ();237 aitString *pStr = (aitString *) resp.dataVoid ();
233 for ( index = 0; index<count; index++ ) {238 for ( index = 0; index<count; index++ ) {
234 if ( ! this->enumStrTbl.setString ( index, pStr[index].string() ) ) {239 if ( ! this->enumStrTbl.setString ( index, pStr[index].string() ) ) {
235 errMessage ( S_cas_noMemory, 240 casErrMessage ( S_cas_noMemory,
236 "no memory to set enumerated PV string cache" );241 "no memory to set enumerated PV string cache" );
237 }242 }
238 }243 }
@@ -241,19 +246,18 @@ void casPVI::updateEnumStringTableAsyncCompletion ( const gdd & resp )
241 aitFixedString *pStr = (aitFixedString *) resp.dataVoid ();246 aitFixedString *pStr = (aitFixedString *) resp.dataVoid ();
242 for ( index = 0; index < count; index++ ) {247 for ( index = 0; index < count; index++ ) {
243 if ( ! this->enumStrTbl.setString ( index, pStr[index].fixed_string ) ) {248 if ( ! this->enumStrTbl.setString ( index, pStr[index].fixed_string ) ) {
244 errMessage ( S_cas_noMemory, 249 casErrMessage ( S_cas_noMemory,
245 "no memory to set enumerated PV string cache" );250 "no memory to set enumerated PV string cache" );
246 }251 }
247 }252 }
248 }253 }
249 else {254 else {
250 errMessage ( S_cas_badType, 255 casErrMessage( S_cas_badType,
251 "application type \"enums\" string conversion"256 "bad \"enums\" string conversion table for enumerated PV" );
252 " table for enumerated PV isnt a string type?" );
253 }257 }
254 }258 }
255 else {259 else {
256 errMessage ( S_cas_badType, 260 casErrMessage ( S_cas_badType,
257 "application type \"enums\" string conversion table"261 "application type \"enums\" string conversion table"
258 " for enumerated PV was multi-dimensional"262 " for enumerated PV was multi-dimensional"
259 " (expected vector of strings)" );263 " (expected vector of strings)" );

Subscribers

People subscribed via source and target branches