| Index: visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/PluginDebuggerGDB.cs
|
| diff --git a/visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/PluginDebuggerGDB.cs b/visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/PluginDebuggerGDB.cs
|
| index f4cebfe179bd270e6cd4bec86e72f39459e4cbc8..704d70c3a4e5b5de2e29dc28f8fe24e596c579c5 100644
|
| --- a/visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/PluginDebuggerGDB.cs
|
| +++ b/visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/PluginDebuggerGDB.cs
|
| @@ -8,6 +8,7 @@ namespace NativeClientVSAddIn
|
| using System.IO;
|
| using System.Text;
|
| using System.Windows.Forms;
|
| + using System.Diagnostics;
|
|
|
| using EnvDTE;
|
| using EnvDTE80;
|
| @@ -60,7 +61,21 @@ namespace NativeClientVSAddIn
|
| public PluginDebuggerGDB(DTE2 dte, PropertyManager properties)
|
| : base(dte, properties)
|
| {
|
| - irtPath_ = properties.IrtPath;
|
| + string arch = "x86_32";
|
| + if (Environment.Is64BitOperatingSystem)
|
| + {
|
| + arch = "x86_64";
|
| + }
|
| + string chrome_path = properties.LocalDebuggerCommand;
|
| + FileVersionInfo version_info = FileVersionInfo.GetVersionInfo(chrome_path);
|
| + string file_version = version_info.FileVersion;
|
| + irtPath_ = Path.Combine(Path.GetDirectoryName(chrome_path), file_version, "nacl_irt_" + arch + ".nexe");
|
| + if (!File.Exists(irtPath_))
|
| + {
|
| + MessageBox.Show("NaCL IRT not found in chrome install.\nLooking for: " + irtPath_);
|
| + irtPath_ = null;
|
| + }
|
| +
|
| manifestPath_ = properties.ManifestPath;
|
| pluginAssembly_ = properties.PluginAssembly;
|
| pluginProjectDirectory_ = properties.ProjectDirectory;
|
| @@ -162,8 +177,14 @@ namespace NativeClientVSAddIn
|
| contents.AppendFormat("file \"{0}\"\n", pluginAssemblyEscaped);
|
| }
|
|
|
| - string irtPathEscaped = irtPath_.Replace("\\", "\\\\");
|
| - contents.AppendFormat("nacl-irt {0}\n", irtPathEscaped);
|
| + // irtPath_ could be null if the irt nexe was not found in the chrome
|
| + // install.
|
| + if (irtPath_ != null)
|
| + {
|
| + string irtPathEscaped = irtPath_.Replace("\\", "\\\\");
|
| + contents.AppendFormat("nacl-irt \"{0}\"\n", irtPathEscaped);
|
| + }
|
| +
|
| contents.AppendFormat("target remote localhost:{0}\n", 4014);
|
|
|
| // Insert breakpoints from Visual Studio project.
|
|
|