~ubuntu-branches/ubuntu/natty/monodevelop/natty

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.Moonlight/MoonlightSoftDebuggerEngine.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2010-01-07 19:06:58 UTC
  • mto: (1.6.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 46.
  • Revision ID: james.westby@ubuntu.com-20100107190658-z9z95lgk4kwfes7p
ImportĀ upstreamĀ versionĀ 2.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// 
 
2
// MoonlightSoftDebuggerEngine.cs
 
3
//  
 
4
// Author:
 
5
//       Michael Hutchinson <mhutchinson@novell.com>
 
6
// 
 
7
// Copyright (c) 2009 Novell, Inc. (http://www.novell.com)
 
8
// 
 
9
// Permission is hereby granted, free of charge, to any person obtaining a copy
 
10
// of this software and associated documentation files (the "Software"), to deal
 
11
// in the Software without restriction, including without limitation the rights
 
12
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 
13
// copies of the Software, and to permit persons to whom the Software is
 
14
// furnished to do so, subject to the following conditions:
 
15
// 
 
16
// The above copyright notice and this permission notice shall be included in
 
17
// all copies or substantial portions of the Software.
 
18
// 
 
19
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
20
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
21
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 
22
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
23
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 
24
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 
25
// THE SOFTWARE.
 
26
 
 
27
using System;
 
28
using System.Collections.Generic;
 
29
using System.IO;
 
30
using MonoDevelop.Debugger;
 
31
using MonoDevelop.Core;
 
32
using MonoDevelop.Core.Execution;
 
33
using MonoDevelop.Moonlight;
 
34
using Mono.Debugging.Client;
 
35
using MonoDevelop.Debugger.Soft;
 
36
using System.Net;
 
37
 
 
38
namespace MonoDevelop.Debugger.Soft.Moonlight
 
39
{
 
40
        public class MoonlightSoftDebuggerEngine: IDebuggerEngine
 
41
        {
 
42
                public string Id {
 
43
                        get {
 
44
                                return "Mono.Debugger.Soft.Moonlight";
 
45
                        }
 
46
                }
 
47
 
 
48
                public bool CanDebugCommand (ExecutionCommand command)
 
49
                {
 
50
                        if (PropertyService.IsMac || PropertyService.IsWindows)
 
51
                                return false;
 
52
                        
 
53
                        var cmd = command as MoonlightExecutionCommand;
 
54
                        return cmd != null && cmd.Url.StartsWith ("file://");
 
55
                }
 
56
                
 
57
                public DebuggerStartInfo CreateDebuggerStartInfo (ExecutionCommand command)
 
58
                {
 
59
                        var cmd = (MoonlightExecutionCommand) command;
 
60
                        var msi = new MoonlightDebuggerStartInfo (cmd.AppName, cmd.Url);
 
61
                        msi.SetUserAssemblies (cmd.UserAssemblyPaths);
 
62
                        return msi;
 
63
                }
 
64
 
 
65
                public DebuggerFeatures SupportedFeatures {
 
66
                        get {
 
67
                                return DebuggerFeatures.Breakpoints | 
 
68
                                           DebuggerFeatures.Pause | 
 
69
                                           DebuggerFeatures.Stepping | 
 
70
                                           DebuggerFeatures.DebugFile |
 
71
                                           DebuggerFeatures.Catchpoints;
 
72
                        }
 
73
                }
 
74
                
 
75
                public DebuggerSession CreateSession ()
 
76
                {
 
77
                        return new MoonlightSoftDebuggerSession ();
 
78
                }
 
79
                
 
80
                public ProcessInfo[] GetAttachableProcesses ()
 
81
                {
 
82
                        return new ProcessInfo[0];
 
83
                }
 
84
                
 
85
                public string Name {
 
86
                        get {
 
87
                                return "Mono Soft Debugger for Moonlight";
 
88
                        }
 
89
                }
 
90
        }
 
91
        
 
92
        class MoonlightDebuggerStartInfo : RemoteDebuggerStartInfo
 
93
        {
 
94
                public string Url { get; private set; }
 
95
                
 
96
                public MoonlightDebuggerStartInfo (string appName, string url)
 
97
                        : base (appName, IPAddress.Loopback, 10000)
 
98
                {
 
99
                        this.Url = url;
 
100
                }
 
101
        }
 
102
}