OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 namespace NativeClientVSAddIn | 5 namespace NativeClientVSAddIn |
6 { | 6 { |
7 using System; | 7 using System; |
8 using System.IO; | 8 using System.IO; |
9 using System.Text; | 9 using System.Text; |
10 using System.Windows.Forms; | 10 using System.Windows.Forms; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 /// <summary> | 56 /// <summary> |
57 /// Constructs the PluginDebuggerHelper. | 57 /// Constructs the PluginDebuggerHelper. |
58 /// </summary> | 58 /// </summary> |
59 /// <param name="dte">Automation object from Visual Studio.</param> | 59 /// <param name="dte">Automation object from Visual Studio.</param> |
60 /// <param name="properties">PropertyManager pointing to a valid project/pla
tform.</param> | 60 /// <param name="properties">PropertyManager pointing to a valid project/pla
tform.</param> |
61 public PluginDebuggerGDB(DTE2 dte, PropertyManager properties) | 61 public PluginDebuggerGDB(DTE2 dte, PropertyManager properties) |
62 : base(dte, properties) | 62 : base(dte, properties) |
63 { | 63 { |
64 string arch = "i686"; | 64 string arch = "i686"; |
65 if (Environment.Is64BitOperatingSystem) | 65 if (Environment.Is64BitOperatingSystem) |
66 { | |
67 arch = "x86_64"; | 66 arch = "x86_64"; |
68 } | |
69 | 67 |
70 if (!properties.IsPNaCl()) | 68 if (!properties.IsPNaCl()) |
71 { | 69 { |
72 if (properties.TargetArchitecture != arch) | 70 if (properties.TargetArchitecture != arch) |
73 { | 71 { |
74 MessageBox.Show(string.Format("Debugging of {0} NaCl modules is
not possible on this system ({1}).", | 72 MessageBox.Show(string.Format("Debugging of {0} NaCl modules is
not possible on this system ({1}).", |
75 properties.TargetArchitecture, arc
h)); | 73 properties.TargetArchitecture, arc
h)); |
76 } | 74 } |
77 } | 75 } |
78 | 76 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 } | 126 } |
129 } | 127 } |
130 } | 128 } |
131 | 129 |
132 manifestPath_ = properties.ManifestPath; | 130 manifestPath_ = properties.ManifestPath; |
133 targetNexe_ = properties.PluginAssembly; | 131 targetNexe_ = properties.PluginAssembly; |
134 | 132 |
135 if (properties.IsPNaCl()) | 133 if (properties.IsPNaCl()) |
136 { | 134 { |
137 string basename = Path.GetFileNameWithoutExtension(targetNexe_); | 135 string basename = Path.GetFileNameWithoutExtension(targetNexe_); |
| 136 string suffix = "32"; |
| 137 if (Environment.Is64BitOperatingSystem) |
| 138 suffix = "64"; |
138 targetNexe_ = Path.Combine(Path.GetDirectoryName(targetNexe_), | 139 targetNexe_ = Path.Combine(Path.GetDirectoryName(targetNexe_), |
139 basename + "_" + arch + ".nexe"); | 140 basename + "_" + suffix + ".nexe"); |
140 | 141 |
141 if (!File.Exists(targetNexe_)) | 142 if (!File.Exists(targetNexe_)) |
142 { | 143 { |
143 MessageBox.Show( | 144 MessageBox.Show( |
144 string.Format("Failed to find nexe to debug: {0}", targetNexe_))
; | 145 string.Format("Failed to find nexe to debug: {0}", targetNexe_))
; |
145 } | 146 } |
146 } | 147 } |
147 | 148 |
148 projectDirectory_ = properties.ProjectDirectory; | 149 projectDirectory_ = properties.ProjectDirectory; |
149 gdbPath_ = Path.Combine( | 150 gdbPath_ = Path.Combine( |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 gdbProcess_.Start(); | 297 gdbProcess_.Start(); |
297 } | 298 } |
298 catch (Exception e) | 299 catch (Exception e) |
299 { | 300 { |
300 MessageBox.Show( | 301 MessageBox.Show( |
301 string.Format("NaCl-GDB Start Failed. {0}. Path: {1}", e.Message, gd
bPath_)); | 302 string.Format("NaCl-GDB Start Failed. {0}. Path: {1}", e.Message, gd
bPath_)); |
302 } | 303 } |
303 } | 304 } |
304 } | 305 } |
305 } | 306 } |
OLD | NEW |