Debian 上的单声道调试信息有异常吗?
我认为 apt-get install mono-dbg 可以解决这个问题,但我错了。如何使用 Mono 获取调试信息?我正在使用 debian squeeze,但在 debian lenny 或 etch 上无法弄清楚。
我在下面写了一个虚拟程序,我希望有一个行号,但我得到了这个。这是来自控制台/终端的复制/粘贴。
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);
}
}
}
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
Code:
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);
}
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要获取文件名和行号,请使用-debug(例如gmcs -debug prog.cs)编译应用程序,然后运行mono --debug prog.exe 。
mono-dbg 软件包为您提供了 /usr/bin/mono (和 libmono)的调试符号。
To get file names and line numbers, compile your application with -debug (like gmcs -debug prog.cs) and then run mono --debug prog.exe.
The mono-dbg package gives you debugging symbols for /usr/bin/mono (and libmono).