14

私はそれを解決すると思いapt-get install mono-dbgましたが、私は間違っていました。monoでデバッグ情報を取得するにはどうすればよいですか?私はdebiansqueezeを使用していますが、debianlennyまたは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);
        }
    }
}
4

1 に答える 1

16

ファイル名と行番号を取得するには、-debuggmcs -debug prog.csなど)を使用してアプリケーションをコンパイルしてから、 mono--debugprog.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 
于 2011-03-16T03:33:43.637 に答える