Ubuntu 12.04,Mono 2.10.8.1-5
我已经构建了MonoDevelop默认创建的"hello world“控制台应用程序。它像预期的那样运行。当我添加trace选项(是否定向到文件中)时,我会得到如下内容:
[0x7f24da6eb740: 0.00000 0] ENTER: (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr)([System.OutOfMemoryException:0x7f24da52af60], 0x7fff953e6510, (nil), 0x40e79a70, )
[0x7f24da6eb740: 0.00012 1] ENTER: System.OutOfMemoryException:.ctor (string)(this:0x7f24da52af60[System.OutOfMemoryException monotracetest.exe], [STRING:0x7f24da551e70:Out of memory], )
[0x7f24da6eb740: 0.00021 2] ENTER: System.SystemException:.ctor (string)(this:0x7f24da52af60[System.OutOfMemoryException monotracetest.exe], [STRING:0x7f24da551e70:Out of memory], )
[0x7f24da6eb740: 0.00030 3] ENTER: System.Exception:.ctor (string)(this:0x7f24da52af60[System.OutOfMemoryException monotracetest.exe], [STRING:0x7f24da551e70:Out of memory], )
[0x7f24da6eb740: 0.00031 3] LEAVE: System.Exception:.ctor (string)..going持续了将近900行关于堆栈溢出,内存不足,以及更多看起来没有恶意的事情。
除了'--help- trace‘之外,我没有找到任何关于跟踪选项的文档。我应该期待什么?这实际上是在报告问题吗?当我将'console.writeline("hello world")‘包装在try catch块中时,没有抛出异常。(当然,一个未处理的异常可能会使程序崩溃。)
我最初的程序是测试调用本机代码库,我将其简化为以下代码,以查看它失败的地方。
我怎样才能把小麦和谷壳分开?
发布于 2012-08-24 15:07:37
这就是预期的输出:没有抛出异常,但是运行时需要在启动时构建一些对象(例如OutOfMemory异常对象:当条件发生时,可能没有内存可供分配!)。
至于减少输出,在--help-trace中有什么不清楚的地方?例如,如果您只想获取System.IO命名空间中的类和方法的跟踪,您将发出以下命令:
跟踪单声道--
=N:System.IO program.exe
https://stackoverflow.com/questions/12098808
复制相似问题