CNC 共享内存通信通道
#0 rcs_shm_open (key=1003, size=8192, oflag=512) at libnml/os_intf/_shm.c:235
#1 0x00140ee8 in RCS_SHAREDMEM (this=0x805e1e8, key=8224788, size=134603264, oflag=<value optimized out>, mode=511) at libnml/os_intf/shm.cc:40
#2 0x00143698 in SHMEM::open (this=0x805d8d0) at libnml/buffer/shmem.cc:189
#3 0x00144100 in SHMEM (this=0x805d8d0,
bufline=0xbfffeddc "B emcError", ' ' <repeats 14 times>, "SHMEM localhost 8192 0 0 3 16 1003 TCP=5005 xdr queue\n",
procline=0xbfffeea4 "P emcsvr emcError LOCAL localhost R 1 1.0 1 2\n", set_to_server=0, set_to_master=0)
at libnml/buffer/shmem.cc:160
#4 0x0014ec58 in cms_create (cms=0x805d81c,
buffer_line=0xbfffeddc "B emcError", ' ' <repeats 14 times>, "SHMEM localhost 8192 0 0 3 16 1003 TCP=5005 xdr queue\n",
proc_line=0xbfffeea4 "P emcsvr emcError LOCAL localhost R 1 1.0 1 2\n", buffer_type=0xbfffef6c "SHMEM",
proc_type=0xbffff034 "LOCAL", set_to_server=0, set_to_master=0) at libnml/cms/cms_cfg.cc:904
#5 0x001501d8 in cms_config (cms=0x805d81c, bufname=0x804dd6d "emcError", procname=0x804dd26 "emcsvr",
filename=0x80521c0 "/home/zcnc/linuxcnc-dev/configs/common/linuxcnc.nml", set_to_server=0, set_to_master=0) at libnml/cms/cms_cfg.cc:491
#6 0x00164cfc in NML::reconstruct (this=0x805d6d0, f_ptr=0x8048e38 <_Z14nmlErrorFormatlPvP3CMS@plt>, buf=0x804dd6d "emcError", proc=0x804dd26 "emcsvr",
file=0x80521c0 "/home/zcnc/linuxcnc-dev/configs/common/linuxcnc.nml", set_to_server=0, set_to_master=0) at libnml/nml/nml.cc:245
#7 0x00164fb9 in NML (this=0x805d6d0, f_ptr=0x8048e38 <_Z14nmlErrorFormatlPvP3CMS@plt>, buf=0x804dd6d "emcError", proc=0x804dd26 "emcsvr",
file=0x80521c0 "/home/zcnc/linuxcnc-dev/configs/common/linuxcnc.nml", set_to_server=0, set_to_master=0, __in_chrg=<value optimized out>,
__vtt_parm=<value optimized out>) at libnml/nml/nml.cc:195
#8 0x080493dc in main (argc=3, argv=0xbffff474) at emc/task/emcsvr.cc:116
(gdb) frame
#0 rcs_shm_open (key=1003, size=8192, oflag=512) at libnml/os_intf/_shm.c:235
235 if ((shm->addr = (void *) shmat(shm->id, 0, shmflg)) == (void *) -1) {
信号量生成
#0 rcs_sem_create (id=1003, mode=511, state=1) at libnml/os_intf/_sem.c:348
#1 0x00140ce6 in RCS_SEMAPHORE (this=0x805e260, _id=1003, _oflag=<value optimized out>, _time=1, _mode=511, _state=1) at libnml/os_intf/sem.cc:34
#2 0x00143709 in SHMEM::open (this=0x805d8d0) at libnml/buffer/shmem.cc:215
#3 0x00144100 in SHMEM (this=0x805d8d0,
bufline=0xbfffeddc "B emcError", ' ' <repeats 14 times>, "SHMEM localhost 8192 0 0 3 16 1003 TCP=5005 xdr queue\n",
procline=0xbfffeea4 "P emcsvr emcError LOCAL localhost R 1 1.0 1 2\n", set_to_server=0, set_to_master=0)
at libnml/buffer/shmem.cc:160
#4 0x0014ec58 in cms_create (cms=0x805d81c,
buffer_line=0xbfffeddc "B emcError", ' ' <repeats 14 times>, "SHMEM localhost 8192 0 0 3 16 1003 TCP=5005 xdr queue\n",
proc_line=0xbfffeea4 "P emcsvr emcError LOCAL localhost R 1 1.0 1 2\n", buffer_type=0xbfffef6c "SHMEM",
proc_type=0xbffff034 "LOCAL", set_to_server=0, set_to_master=0) at libnml/cms/cms_cfg.cc:904
#5 0x001501d8 in cms_config (cms=0x805d81c, bufname=0x804dd6d "emcError", procname=0x804dd26 "emcsvr",
filename=0x80521c0 "/home/zcnc/linuxcnc-dev/configs/common/linuxcnc.nml", set_to_server=0, set_to_master=0) at libnml/cms/cms_cfg.cc:491
#6 0x00164cfc in NML::reconstruct (this=0x805d6d0, f_ptr=0x8048e38 <_Z14nmlErrorFormatlPvP3CMS@plt>, buf=0x804dd6d "emcError", proc=0x804dd26 "emcsvr",
file=0x80521c0 "/home/zcnc/linuxcnc-dev/configs/common/linuxcnc.nml", set_to_server=0, set_to_master=0) at libnml/nml/nml.cc:245
#7 0x00164fb9 in NML (this=0x805d6d0, f_ptr=0x8048e38 <_Z14nmlErrorFormatlPvP3CMS@plt>, buf=0x804dd6d "emcError", proc=0x804dd26 "emcsvr",
file=0x80521c0 "/home/zcnc/linuxcnc-dev/configs/common/linuxcnc.nml", set_to_server=0, set_to_master=0, __in_chrg=<value optimized out>,
__vtt_parm=<value optimized out>) at libnml/nml/nml.cc:195
#8 0x080493dc in main (argc=3, argv=0xbffff474) at emc/task/emcsvr.cc:116
(gdb) s
355 sem = rcs_sem_open(id, IPC_CREAT, mode);
(gdb) s
353 rcs_sem_open_val = state;