如何重定向 Tornado / VXWorks shell 输出?

发布于 2024-07-06 11:00:35 字数 540 浏览 11 评论 0原文

我最近一直在开发一个嵌入式 C/C++ 项目,使用 Tornado 2 中的 shell 作为调试我们套件中发生的情况的一种方式。 这种方法的唯一问题是它是一个复杂的系统,因此会产生相当多的输出。 每当有新信息到达时,龙卷风都会“有用地”滚动窗口,这意味着如果您发现错误,它会很快从站点中消失而无法看到。 每次向上滚动查看时,系统都会添加更多信息,因此查看它的唯一方法是断开硬件连接。

我很想知道是否有人有办法重定向龙卷风的输出?

我希望有一种方法可以从一个小型 python 应用程序中记录所有内容,以便我可以对传入的信息应用过滤器。 我尝试连接到 Tornado 进程,但包含信息的窗口不是标准的 CEditCtrl,因此以这种方式提取文本是一个死胡同。

有人有什么想法吗?

[编辑] 我应该提到,我们只运行 Tornado 2.1.0,升级到更新的版本超出了我的控制范围。

[Edit2] 根据 WinID,Tornado 中的相关窗口是“AfxFrameOrView42”。

I've been working on an embedded C/C++ project recently using the shell in Tornado 2 as a way of debugging what's going on in our kit. The only problem with this approach is that it's a complicated system and as a result, has a fair bit of output. Tornado 'helpfully' scrolls the window every time some new information arrives which means that if you spot an error, it disappears out of site too quickly to see. Each time you scroll up to look, the system adds more information, so the only way to view it is to disconnect the hardware.

I'd love to know if anyone has a way of redirecting the output from Tornado?

I was hoping there might be a way to log it all from a small python app so that I can apply filters to the incoming information. I've tried connecting into the Tornado process, but the window with the information isn't a standard CEditCtrl so extracting the text that way was a dead end.

Any ideas anyone?

[Edit] I should have mentioned that we're only running Tornado 2.1.0 and upgrading to a more recent version is beyond my control.

[Edit2] The window in question in Tornado is an 'AfxFrameOrView42' according to WinID.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

鹤仙姿 2024-07-13 11:00:35

这是另一种可能的方法:

-> saveFd = open("myfile.txt",0x102, 0777 )
-> oldFd = ioGlobalStdGet(1)
-> ioGlobalStdSet(1, saveFd)
-> runmytest()
...
-> ioGlobalStdSet(1, oldFd)

这会将所有标准输出活动重定向到您打开的文件。
您可能需要使用打开的文件名以使其写入主机(例如使用“host:/myfile.txt”或类似的内容)

here is another potential way:

-> saveFd = open("myfile.txt",0x102, 0777 )
-> oldFd = ioGlobalStdGet(1)
-> ioGlobalStdSet(1, saveFd)
-> runmytest()
...
-> ioGlobalStdSet(1, oldFd)

this will redirect all stdout activity to the file you opened.
You might have to play around with the file name of the open to make it write on the host (e.g. use "host:/myfile.txt" or something like this)

战皆罪 2024-07-13 11:00:35

主机外壳具有内置的录音功能。
有 3 个可用的环境变量(在 6.x 中 - 在 5.x 中不可用):

RECORD(开/关):控制 shell 的记录
RECORD_TYPE(输入/输出/全部):确定您将录制的内容
RECORD_FILE :保存内容的文件名。

您可以使用 ?shConfig 命令来配置 shell 环境变量。
?shConfig 本身显示变量。
这是我的设置方法:


-> ?shConfig
...
RECORD = off
RECORD_FILE = C:/test.txt
RECORD_TYPE = output
...

-> ?shConfig RECORD_TYPE all
-> ?shConfig RECORD_FILE myData.txt
-> ?shConfig RECORD on
Started recording commands in 'myData.txt'.

The host shell has a recording capability built in.
There are 3 environment variables available (in 6.x - not available in 5.x):

RECORD (on/off) : Controls recording of the shell
RECORD_TYPE (input/output/all): Determines what you will be recording
RECORD_FILE : Filename to save things to.

you use the ?shConfig command to configure the shell environment variable.
?shConfig by itself displays the variables.
Here is how I set mine up:


-> ?shConfig
...
RECORD = off
RECORD_FILE = C:/test.txt
RECORD_TYPE = output
...

-> ?shConfig RECORD_TYPE all
-> ?shConfig RECORD_FILE myData.txt
-> ?shConfig RECORD on
Started recording commands in 'myData.txt'.
自控 2024-07-13 11:00:35

我假设您正在使用主机 shell 来执行此操作。

如果您通过从 shell 启动测试(如“runTest()”)来运行测试,则可以使用重定向运算符 (>) 将该函数的输出发送到主机上的文本文件。

 > runTest() > mytestResults.txt

这会将 runTest 生成的任何输出保存到文件 mytestResults.txt

如果您想始终捕获屏幕上的所有内容,我将不得不对此进行更多研究。

I am making the assumption that you are using the host shell to perform this.

If you are running a test by launching it from the shell like "runTest()", you can use the redirection operator (>) to send the output of that function to a text file on your host machine.

 > runTest() > mytestResults.txt

This will save any output that runTest generates to the file mytestResults.txt

If you would like to capture everything on the screen all the time, I will have to dig more into this.

转角预定愛 2024-07-13 11:00:35

rlogin vxWorks-目标 | tee 重定向输出.txt

rlogin vxWorks-target | tee redirected-output.txt

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文