在调试工具中运行外部程序
MathLink 允许在所用软件环境提供的各种调试工具中运行外部程序.
与 MathLink 兼容的程序一般是从命令行得到指定 MathLink 连接的变量.
| 在调试工具中: | run -linkcreate -linkprotocol TCPIP |
| 在 Mathematica 中: | Install[LinkConnect["port",LinkProtocol->"TCPIP"]] |
在调试工具中运行外部程序.
注意,为了得到在调试工具中能运行的外部程序,必须编译该程序使得输出可用于对应的调试工具. Unix 编译通常使用
作为命令行变量来产生可调试的程序. 参见编译文档以得到应该采取的步骤的具体信息.
Unix 调试工具
在 C 函数

中设立中断点.
break f
Breakpoint set: f: line 1
run -linkcreate -linkprotocol TCPIP
Link created on: 2981@frog.wolfram.com,2982@frog.wolfram.com
Mathematica 会话
| Out[1]= |  |
Unix 调试工具
Mathematica 会话
现在返回了

.
| Out[3]= |  |