Skip to content

Commit af652c2

Browse files
committed
Move registerRecordDeviceDriver to imports.py
Otherwise import softioc.device will seg fault
1 parent 0448475 commit af652c2

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎softioc/builder.py‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,6 @@
55
from .softioc import dbLoadDatabase
66

77
from epicsdbbuilder import *
8-
from epicscorelibs import path
9-
from epicscorelibs.ioc import \
10-
iocshRegisterCommon, registerRecordDeviceDriver, pdbbase
11-
12-
iocshRegisterCommon()
13-
dbLoadDatabase("base.dbd", os.path.join(path.base_path, "dbd"))
14-
dbLoadDatabase("devIocStats.dbd", os.path.dirname(__file__))
15-
16-
if registerRecordDeviceDriver(pdbbase):
17-
raise RuntimeError('Error registering')
188

199
InitialiseDbd()
2010
LoadDbdFile(os.path.join(os.path.dirname(__file__), 'device.dbd'))

‎softioc/imports.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
from ctypes import *
88

99
from epicscorelibs import path
10+
from epicscorelibs.ioc import \
11+
iocshRegisterCommon, registerRecordDeviceDriver, pdbbase
1012

1113
from . import _extension
1214

15+
1316
# These are in the extension
1417
def get_DBF_values():
1518
"""Return {DBF_name: DBF_int_value} mapping"""
@@ -119,6 +122,13 @@ def EpicsDll(dll):
119122
epicsExit = libmiscIoc.epicsExit
120123
epicsExit.argtypes = ()
121124

125+
iocshRegisterCommon()
126+
dbLoadDatabase("base.dbd", os.path.join(path.base_path, "dbd"), None)
127+
dbLoadDatabase("devIocStats.dbd", os.path.dirname(__file__), None)
128+
129+
if registerRecordDeviceDriver(pdbbase):
130+
raise RuntimeError('Error registering')
131+
122132

123133
__all__ = [
124134
'get_field_offsets',

0 commit comments

Comments
 (0)