[Mono-devel-list] Line numbers in stacktraces are off by one

Hans Kratz kratz at omnicore.com
Tue Jun 7 04:23:14 EDT 2005


I just implemented support for hyperlinking Mono exception stacktraces 
in X-develop and noticed that line numbers in stacktraces are off by one.

E.g. for the following program...

class Program
         static void Main(string[] args)
                 string s = null;
                 int i = s.Length; // line 6
         } // line 7

... I get this stacktrace....

$ mono --debug ConsoleApplication45.exe

Unhandled Exception: System.NullReferenceException: Object reference not 
set to an instance of an object
in [0x00003] (at /home/hans/[...]/Program.cs:7) Program:Main 
(System.String[] args)

Is this intentional?

Best regards,

Hans Kratz
Omnicore Software

More information about the Mono-devel-list mailing list