13 debugging mono debian debug-symbols
我以为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
Run Code Online (Sandbox Code Playgroud)
码:
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);
}
}
}
Run Code Online (Sandbox Code Playgroud)
Gon*_*alo 16
要获取文件名和行号,编译应用程序-debug(如系膜细胞-debug prog.cs),然后运行单--debug prog.exe.
mono-dbg包为/ usr/bin/mono(和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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3858 次 |
| 最近记录: |