Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(786)

Unified Diff: visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/PluginDebuggerGDB.cs

Issue 10915292: Use irt from within chrome install (Closed) Base URL: http://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..d5a41b6c2a646754c23a214054bd9f3cd0689241 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,17 @@ namespace NativeClientVSAddIn
public PluginDebuggerGDB(DTE2 dte, PropertyManager properties)
: base(dte, properties)
{
- irtPath_ = properties.IrtPath;
+ string arch = properties.TargetArchitecture;
+ string chrome_path = properties.LocalDebuggerCommand;
+ FileVersionInfo version_info = FileVersionInfo.GetVersionInfo(chrome_path);
+ string file_version = version_info.FileVersion;
binji 2012/09/17 17:52:06 It seems GetVersionInfo can return a FileVersionIn
Sam Clegg 2012/09/17 19:58:16 Done.
+ irtPath_ = Path.Combine(Path.GetDirectoryName(chrome_path), file_version, "nacl_irt_" + arch + ".nexe");
binji 2012/09/17 17:52:06 nit: wrap at 100 chars (for C#)
Sam Clegg 2012/09/17 19:58:16 Done.
+ 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 +173,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);
binji 2012/09/17 17:52:06 what happens when this command isn't run? Is it us
Sam Clegg 2012/09/17 19:58:16 In this case yes, you only need to IRT if you want
+ }
+
contents.AppendFormat("target remote localhost:{0}\n", 4014);
// Insert breakpoints from Visual Studio project.

Powered by Google App Engine
This is Rietveld 408576698