开发者

MonoDevelop debugging?

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?


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.


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.


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜