'mono --trace myapp'?

时间:2012-08-23 19:36:20

标签: debugging mono ubuntu-12.04

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)

..关于堆栈溢出,内存不足以及更无辜的外观,接近900行。

我没有在'--help-trace'之外找到有关trace选项的任何文档。我应该期待什么?这实际上是报告问题吗?当我在try catch块中包装'console.writeline(“hello world”)'时,不会抛出任何异常。 (当然,大概是一个未处理的例外会使程序崩溃。)

我的原始程序是测试调用本机代码库,然后将其缩减到此以查看失败的位置。

如何将小麦与谷壳分开?

1 个答案:

答案 0 :(得分:3)

这是预期的输出:没有抛出异常,但运行时需要在启动时构建一些对象(例如OutOfMemory异常对象:当条件发生时,可能没有内存来分配它!)。< / p>

至于减少输出, - help-trace中不清楚的是什么? 例如,如果要仅获取System.IO命名空间中的类和方法的跟踪,则将发出:

  

mono --trace = N:System.IO program.exe