问题描述
我以为 apt-get install mono-dbg
会解决它,但我错了。如何使用单声道获取调试信息?我正在使用debian压缩,但是不能在debian lenny或者蚀刻上找到它。
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 - 调试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.
单声道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有例外?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!