单声道调试信息与 debian 上的异常? [英] mono debug information with exceptions on debian?

查看:19
本文介绍了单声道调试信息与 debian 上的异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为 apt-get install mono-dbg 会解决它,但我错了.如何使用单声道获取调试信息?我正在使用 debian 挤压,但无法在 debian lenny 或 etch 上弄明白.

I thought apt-get install mono-dbg would solve it but i was wrong. How do i get debug information with mono? i am using debian squeeze but couldnt figure it out on debian lenny or etch.

我在下面写了一个虚拟程序,我希望有一个行号,但我得到了这个.这是来自控制台/终端的复制/粘贴.

I wrote a dummy program below and i was hoping for a line number but i got this instead. This is a copy/paste from the console/terminal.

Unhandled Exception: System.Exception: nooo blah
  at ExceptionTest.Program.func (Int32 a) [0x00000] in <filename unknown>:0
  at ExceptionTest.Program.func (Int32 a) [0x00000] in <filename unknown>:0
  at ExceptionTest.Program.func (Int32 a) [0x00000] in <filename unknown>:0
  at ExceptionTest.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ExceptionTest
{
    class Program
    {
        static void Main(string[] args)
        {
            func(3);
        }
        static void func(int a)
        {
            if (a == 18)
                throw new Exception("nooo blah");
            func(a + a + 2);
        }
    }
}

推荐答案

要获取文件名和行号,请​​使用 -debug 编译您的应用程序(如 gmcs -debug prog.cs) 然后运行 ​​mono --debug prog.exe.

To get file names and line numbers, compile your application with -debug (like gmcs -debug prog.cs) and then run mono --debug prog.exe.

mono-dbg 包为您提供/usr/bin/mono(和 libmono)的调试符号.

The mono-dbg package gives you debugging symbols for /usr/bin/mono (and libmono).

$ gmcs -debug prog.cs
$ mono --debug prog.exe

Unhandled Exception: System.Exception: nooo blah
  at ExceptionTest.Program.func (Int32 a) [0x0001d] in /tmp/prog.cs:19 
  at ExceptionTest.Program.func (Int32 a) [0x00013] in /tmp/prog.cs:18 
  at ExceptionTest.Program.func (Int32 a) [0x00013] in /tmp/prog.cs:18 
  at ExceptionTest.Program.Main (System.String[] args) [0x00000] in /tmp/prog.cs:12 

这篇关于单声道调试信息与 debian 上的异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆