views:

398

answers:

3

Ok, this seems like a dumb question because MonoDevelop is getting more mature, so I'm sure I'm just missing it, but I looked around and all the questions about this subject seem to be about remote debugging or debugging on a Mac.

I'm using Ubuntu 10.04 Lucid Lynx, and I just installed MonoDevelop 2.2.1 from the software center. I created a GTk# 2.0 project, added some widgets and code and everything seems to run fine. Then I added a breakpoint, and it shows up in my breakpoints window, and it says it's active, but the breakpoint never actually hits(stops execution and pulls me into the debugger).

I'm in Debug x86 mode, so I can't figure out what's going on.

Anyone have this happening/know what to do about it?

A: 

What versions of Mono runtime and debugger are installed? I tried it with monodevelop 2.2 + mono 2.6 + debugger 0.0.0 under Windows and it works just like expected. Here is a quotation from mono's website, which may be helpful:

Mono comes with two Mono-specific debuggers: a hard debugger and a soft debugger, additionally, you can use the Unix GDB debugger with Mono to debug low level problems

...

Soft Debugger:

...

Moonlight, ASP.NET, Gtk#, iPhone and remote debugging supported

Maybe the problem is in a code? What do you mean by:

... (stops execution and pulls me into the debugger).

n535
I mean the usual experience of hitting a breakpoint. The code execution halts, the IDE window pulls up, you get to check the values of the variables, advance the code 1 line at a time, or hit run and let it resume, etc. None of that happens, it just keeps running as if the breakpoint wasn't there.I'm not sure about versions, I just got MD 2.2.1 from the software center. Do I need to install the debugger separately?
LoveMeSomeCode
You can check versions of various components under the help->about->version info tab. Your problem is quite difficult to investigate with all the information given. I used Monodevelop on Ubuntu Linux and the debugger used to work just out of the box.
n535
+1  A: 

To check whether you have a debugger installed, simply check whether the "Run" menu contains a "Debug" command.

You should be aware that Ubuntu ships a rather old version of Mono (2.4) which has no built-in "sdb" debugger, and its version of MonoDevelop 2.2 is patched to remove the sdb interface. To get semi-functional debugging, install the old "mdb" debugger - the mono-debugger and monodevelop-debugger-mdb packages, IIRC.

To get the best debugging experience (sdb), you need Mono 2.6+ and an unmodified MonoDevelop 2.2+. If you decide to build Mono from source, please read this and this first. Alternatively, you could use openSUSE, which has up-to-date Mono and MonoDevelop packages available.

mhutch
+1  A: 

I'm having the same problem (also on Ubuntu 10.04) and found kind of a hack that is working for me. Instead of setting a breakpoint in the IDE (by clicking on the side or hitting F9), make a call to the System.Diagnostics.Debugger.Break() method in your code where you want the execution to break. After doing that, I am able to step through the code, use the immediate window, etc. Obviously, it's not a very good solution, but at least it's something.

Brandon
I'm in the exact same boat. Ubuntu 10.04, mono-runtime 2.6.3-2~dhx1, Mono-develop 2.4+ and seeing the exact same thing. But your workaround works for me. Thanks! +1
rotard
Actually, today it doesn't seem to work any more...
rotard