8

While debugging a project in MonoDevelop how can I step into Mono Framework source code?

I'm running the vanilla MonoDevelop from openSUSE 11.3.

Vitor Py
  • 5,145
  • 4
  • 39
  • 62
  • 1
    I'm pretty interested in finding out how to do this. There seems to be some information here, it looks like a feature request that was implemented: https://bugzilla.novell.com/show_bug.cgi?id=613000 I know MonoDevelop for the Mac has this setting in the preferences but I am unsure how to acquire the correct debug source and how to set the path from within MonoDevelop. As in the link I can get see the stack trace when the framework code is entered, but I cannot step into it with all the features of debugging using the IDE. – fletcher Jul 18 '10 at 22:15

4 Answers4

5

This is an old post, but I stumbled upon it looking for the answer today, so hopefully it will help someone else out. Just unchecking the "Do not step into framework code" doesn't work unless you have the source in the location the PDB/MDB files point to. On my box, it was looking for the source at "/usr/src/packages/BUILD/mono-2.10".

In order to find out specifically where it should go for you, generate and log out an exception that contains a stack trace involving the framework (new SqlConnection(null) for example) and it will show you the file location its looking for the source in. For example:

  at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, Int32 offset, Int32 size) [0x00065] in /usr/src/packages/BUILD/mono-2.10/mcs/class/System/System.Net.Sockets/NetworkStream.cs:369 
  at Mono.Data.Tds.Protocol.TdsComm.Read (System.Byte[] buffer, Int32 offset, Int32 count) [0x00000] in /usr/src/packages/BUILD/mono-2.10/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsComm.cs:630 
  --- End of inner exception stack trace ---
Greg Biles
  • 941
  • 2
  • 10
  • 10
4

A key part of the answer if you're just setting up a Mono environment is where to install the source files. For the standard Mono build on Ubuntu Natty, this is /build/buildd. So to get the source of mono 2.6.7 (the Ubuntu build), do:

sudo mkdir /build
cd /build
sudo mkdir buildd
cd buildd
sudo apt-get source mono
sudo apt-get install mono-dbg

Then ensure you have "Do not step into framework code" unchecked in monodevelop and it should be able to find the sources.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
Ben Last
  • 801
  • 8
  • 6
  • I just tested on Ubuntu 12.04. Work like a charm. Edited the format to make the steps more visible. – Lex Li Mar 30 '13 at 10:01
2

Firstly, your Mono class libraries must have debug symbols pointing to the framework source files. Then you should uncheck the "Do not step into framework code" option in MD debugger options.

Mikayla Hutchinson
  • 16,113
  • 2
  • 44
  • 50
0

I don't have the apt-get source option in Arch Linux, so I did this as root:

# git clone https://github.com/mono/mono.git /opt/mono-src
# mkdir -p /build/mono/src
# ln -s /opt/mono-src /build/mono/src/mono-4.6.1

Instead of these /build paths use your own accordingly to Greg's answer.

Community
  • 1
  • 1
Dmitry Fedorkov
  • 4,301
  • 1
  • 21
  • 30