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
1diff --git a/src/ca/legacy/pcas/generic/casPVI.cc b/src/ca/legacy/pcas/generic/casPVI.cc
2index 50e5d27..48692b9 100644
3--- a/src/ca/legacy/pcas/generic/casPVI.cc
4+++ b/src/ca/legacy/pcas/generic/casPVI.cc
5@@ -26,6 +26,11 @@
6 #include "casAsyncIOI.h"
7 #include "casMonitor.h"
8
9+
10+// Use casErrMessage instead of errMessage to show PV name
11+#define casErrMessage(S, PM) \
12+ errPrintf(S, __FILE__, __LINE__, ", %s, %s", getName(), PM)
13+
14 casPVI::casPVI ( casPV & intf ) :
15 pCAS ( NULL ), pPV ( & intf ), nMonAttached ( 0u ),
16 nIOAttached ( 0u ), deletePending ( false ) {}
17@@ -146,7 +151,7 @@ caStatus casPVI::updateEnumStringTable ( casCtx & ctxIn )
18 // gddArray(int app, aitEnum prim, int dimen, ...);
19 gdd * pTmp = new gddScalar ( gddAppType_enums );
20 if ( pTmp == NULL ) {
21- errMessage ( S_cas_noMemory,
22+ casErrMessage ( S_cas_noMemory,
23 "unable to create gdd for read of application type \"enums\" string"
24 " conversion table for enumerated PV" );
25 return S_cas_noMemory;
26@@ -156,8 +161,8 @@ caStatus casPVI::updateEnumStringTable ( casCtx & ctxIn )
27 gddAppType_enums, MAX_ENUM_STATES );
28 if ( status != S_cas_success ) {
29 pTmp->unreference ();
30- errMessage ( status,
31- "unable to to config gdd for read of application type \"enums\" string"
32+ casErrMessage ( status,
33+ "unable to config gdd for read of application type \"enums\" string"
34 " conversion table for enumerated PV");
35 return status;
36 }
37@@ -187,9 +192,9 @@ void casPVI::updateEnumStringTableAsyncCompletion ( const gdd & resp )
38 epicsGuard < epicsMutex > guard ( this->mutex );
39
40 if ( resp.isContainer() ) {
41- errMessage ( S_cas_badType,
42- "application type \"enums\" string conversion table for"
43- " enumerated PV was a container (expected vector of strings)" );
44+ casErrMessage ( S_cas_badType,
45+ "Invalid \"enums\" string conversion table for"
46+ " enumerated PV (container instead of vector of strings)" );
47 return;
48 }
49
50@@ -197,14 +202,14 @@ void casPVI::updateEnumStringTableAsyncCompletion ( const gdd & resp )
51 if ( resp.primitiveType() == aitEnumString ) {
52 aitString *pStr = (aitString *) resp.dataVoid ();
53 if ( ! this->enumStrTbl.setString ( 0, pStr->string() ) ) {
54- errMessage ( S_cas_noMemory,
55+ casErrMessage ( S_cas_noMemory,
56 "no memory to set enumerated PV string cache" );
57 }
58 }
59 else if ( resp.primitiveType() == aitEnumFixedString ) {
60 aitFixedString *pStr = (aitFixedString *) resp.dataVoid ();
61 if ( ! this->enumStrTbl.setString ( 0, pStr->fixed_string ) ) {
62- errMessage ( S_cas_noMemory,
63+ casErrMessage ( S_cas_noMemory,
64 "no memory to set enumerated PV string cache" );
65 }
66 }
67@@ -232,7 +237,7 @@ void casPVI::updateEnumStringTableAsyncCompletion ( const gdd & resp )
68 aitString *pStr = (aitString *) resp.dataVoid ();
69 for ( index = 0; index<count; index++ ) {
70 if ( ! this->enumStrTbl.setString ( index, pStr[index].string() ) ) {
71- errMessage ( S_cas_noMemory,
72+ casErrMessage ( S_cas_noMemory,
73 "no memory to set enumerated PV string cache" );
74 }
75 }
76@@ -241,19 +246,18 @@ void casPVI::updateEnumStringTableAsyncCompletion ( const gdd & resp )
77 aitFixedString *pStr = (aitFixedString *) resp.dataVoid ();
78 for ( index = 0; index < count; index++ ) {
79 if ( ! this->enumStrTbl.setString ( index, pStr[index].fixed_string ) ) {
80- errMessage ( S_cas_noMemory,
81+ casErrMessage ( S_cas_noMemory,
82 "no memory to set enumerated PV string cache" );
83 }
84 }
85 }
86 else {
87- errMessage ( S_cas_badType,
88- "application type \"enums\" string conversion"
89- " table for enumerated PV isnt a string type?" );
90+ casErrMessage( S_cas_badType,
91+ "bad \"enums\" string conversion table for enumerated PV" );
92 }
93 }
94 else {
95- errMessage ( S_cas_badType,
96+ casErrMessage ( S_cas_badType,
97 "application type \"enums\" string conversion table"
98 " for enumerated PV was multi-dimensional"
99 " (expected vector of strings)" );

Subscribers

People subscribed via source and target branches