Bug 635 - unable to debug Vala programs, no code completion
Summary: unable to debug Vala programs, no code completion
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Vala Binding ()
Version: Trunk
Hardware: PC Linux
: Lowest normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2011-09-05 04:38 UTC by Alex Williams
Modified: 2014-02-17 15:12 UTC (History)
5 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Alex Williams 2011-09-05 04:38:55 UTC
Ubuntu 11.04 32-bit, MonoDevelop - 2.6 beta 3, Vala plugin version 2.6
I can compile inside IDE and see output, but debugging is not available, you could only run Vala programs
It's known, that in previous versions of MonoDevelop (2.2), this function was fine
also, code completion seems to not functional too

at least, debugging functionality is very important and Vala support is useless since debugging not available
Comment 1 Severin Heiniger 2011-09-10 11:30:17 UTC
I can confirm that this problem still exists in the latest MonoDevelop code, even after the changeset cd5506e015cf1e3eff295ebef5719757f7f8a523 ([Vala] Move to vala 0.12.).

The problem is that libafrodite's API still seems to be evolving. The function 'afrodite_completion_engine_get_ast' does not exist anymore in vtg-0.12.1 (only in the betas of vtg-0.12.0). The following stacktrace is produced:

System.EntryPointNotFoundException: afrodite_completion_engine_get_ast
  at (wrapper managed-to-native) MonoDevelop.ValaBinding.Parser.Afrodite.CompletionEngine:afrodite_completion_engine_get_ast (intptr)
  at MonoDevelop.ValaBinding.Parser.Afrodite.CompletionEngine.TryAcquireAst () [0x00000] in /home/.../monodevelop/extras/ValaBinding/Parser/Afrodite.cs:74 

When using vtg-0.12.0_beta5, the following stack trace is produced instead:

FATAL ERROR [2011-09-10 16:25:48Z]: Unhandled Exception
System.NullReferenceException: Object reference not set to an instance of an object
  at MonoDevelop.ValaBinding.Parser.ProjectInformation.GetTypesVisibleFrom (System.String filename, Int32 line, Int32 column, MonoDevelop.ValaBinding.ValaCompletionDataList results) [0x000f6] in /home/.../monodevelop/extras/ValaBinding/Parser/ProjectInformation.cs:309 

I guess the only way to resolve this problem is to update MonoDevelop's ValaBinding. In the meantime, can you tell me what vtg version/revision the current code targets? I wonder whether the NullPointerException I get with vtg-0.12.0_beta5 is due to not using the right version of vtg or something different.
Comment 2 Severin Heiniger 2011-09-10 13:40:34 UTC
The following fork fixes the System.EntryPointNotFoundException: https://github.com/severinh/monodevelop-vala-afrodite-update
It takes into account all API changes between vtg-0.12.0_beta5 and vtg-0.12.1.

Now the execution results in a NullReferenceException in MonoDevelop.ValaBinding.Parser.ProjectInformation:309 like the original code did in combination with vtg-0.12.0_beta5.
Comment 3 Severin Heiniger 2011-09-10 17:35:36 UTC
The reason for the NullReferenceException is that in my case (Ubuntu 11.10 Beta 1), Afrodite.Utils.GetPackagePaths fails to retrieve the package paths for glib-2.0 and gtk+-3.0, because the corresponding VAPI files are located in /usr/share/vala-0.14/vapi rather than /usr/share/vala/vapi.

One can work around it by creating appropriate symlinks. I'm not exactly sure whether this is MonoDevelop's, Afrodite's or the distribution's fault. Nonetheless, Vala autocompletion in MonoDevelop finally works!
Comment 4 Alex Williams 2011-09-12 04:44:18 UTC
Please, explain what I should do to fix both problems: debugging and autocompletion? Step by step...
I have skill of building Mono and MonoDevelop from sources, I have Mono 2.10.4 from PPA. I hope this problem is only MonoDevelop/Vala plugin related?

I'll try to use your https://github.com/severinh/monodevelop-vala-afrodite-update repository...
I understand about symlinks, but how about debugging?

I want to introduce Vala language into my company and write programs in this language in MonoDevelop IDE... I need build (it's ok), autocomplete and debugger to make this possible...
Comment 5 Levi Bard 2012-01-24 08:41:41 UTC
Debugging should just work, provided that you have the gdb debugger backend (monodevelop-debugger-gdb on ubuntu). Are you able to debug C programs from MD?
Comment 6 Joe 2012-09-10 12:38:20 UTC
What's the status of this? Should debugging and code completion just work? I'm attempting to build updated Mono, MD, and Vala plugin. Have those patches been accepted into upstream?
Comment 7 Lluis Sanchez 2014-02-17 15:12:51 UTC
We don't support this binding anymore.