我可以在shell中显示RTP的全局变量吗?

时间:2008-09-28 01:09:13

标签: vxworks

在VxWorks中,我可以在shell中显示全局变量,如下所示:

-> my_global
my_global = 0x103c4110: value = 4 = 0x4

有没有办法对RTP全局变量做同样的事情?

1 个答案:

答案 0 :(得分:5)

您可以使用命令(cmd)解释器并附加到RTP,在特定RTP中显示全局变量。 以下是括号中带注释的示例。

-> cmd                                   (switch to command interpreter)
[vxWorks *]# rtp exec Hello_RTP.vxe &
Launching process 'Hello_RTP.vxe' ...
Process 'Hello_RTP.vxe' (process Id = 0x105e4d50) launched.
Attachment number for process 'Hello_RTP.vxe' is %1.
[vxWorks *]# echo $my_global             (display my_global in the kernel context)
0x4
[vxWorks *]# %1                          (attach to RTP - can also use rtp attach)
[Hello_RTP]# echo $my_global
0x6b7                                    (global variable from RTP context)
[Hello_RTP]# echo $my_global
0x16e1                                   (same global variable..it increments)
[Hello_RTP]# %0                          (detach from RTP. Go to kernel)
[vxWorks *]# echo $my_global             (back to kernel context)
0x4

请注意,这仅适用于VxWorks 6.x在6版本发布之前,vxWorks中没有RTP。