debugging - 单声道调试信息在 debian 上有异常(exception)?

标签 debugging mono debian debug-symbols

我以为apt-get install mono-dbg会解决它,但我错了。如何使用单声道获取调试信息?我正在使用 debian 挤压,但无法在 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);
        }
    }
}

最佳答案

要获取文件名和行号,请​​使用 编译您的应用程序。 -调试 (如 gmcs -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 

关于debugging - 单声道调试信息在 debian 上有异常(exception)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5317343/

相关文章:

.net - SharpSSH .NET 库 : unable to connect to Linux (Debian) from . NET

visual-studio-2010 - 在 VS 2010 中调试小型转储时遇到问题

ios - willSelectRowAtIndexPath 和 prepareForSegue 之间会发生什么?需要调试建议

.net - 这些属性在 Mono.Cecil 中意味着什么?

c# - PoseProvider.cs 和 Tango : MonoDevelop error

c# - 统一: Android touch on Gui texture

linux - 如何为作为可分发包安装的应用程序获取对/var/lib 文件夹的写入权限

perl - 如何在 Debian etch 上安装 Image::Magick?

java - Windows 上的 Helios Eclipse java 调试器突出显示源代码非常慢

python - Pandas 替换为字符串和整数 - 不正确的行为?