[Mono-devel-list] emitting debug information

Miguel de Icaza miguel at ximian.com
Tue Dec 14 19:52:24 EST 2004


Hello,

   [CCing Martin who can provide more information]

> During our work on the Nemerle compiler we encountered some problems
> with emission of the debug information under mono. There is some API
> defined in the S.R.E. documentation. It works under MS.NET but not
> under Mono. I've seen that some strange hacks with Invoke'ing members
> through reflection is used in mcs (symbolwriter.cs).
> 
> What exactly doesn't work is this:
> 
>   http://nemerle.org/mailman/pipermail/svn/2004-December/003555.html
> 
> (this is patch with changes needed for debug output). Now when given
> program file is compiled with this, mono --debug doesn't print line
> number information when exception is thrown by the program (this is
> the best way I come out to actually check if any debug info is present
> in the image).
> 
> So I've got a few questions:
> 1. Is there any documentation available?
> 2. How to check the debug info in mono-compiled PE image? That is
> check if it's at all present, and if so, dump it somehow.
> 3. What have we done wrong? ;-)

The story is a bit like this, but Martin can probably provide more
information:

        We never were able to figure out how to properly "get" the
        handle to the debugging information symbol writer on .NET, so
        when we had to develop our own, we defined our own internal
        interface.
        
        To see how this is done, look in the Mono C# compiler
        mcs/mcs/symbolwriter.cs, I think most of the information is
        encapsulated there.
        
        This basically uses the internal Mono debugging information
        generator.
        
It is "easy" to see if this worked with Mono 1.1.xx, as the result will
produce a file.exe and a file.exe.mdb.  The later contains the debugging
information.

With Mono 1.0.xx the debugging information is embedded into the
executable as a resource so you will only notice it because the
executable is suffering from bloating ;-)

Miguel.



More information about the Mono-devel-list mailing list