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

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

Issue 10823267: NaCl VS Addin Crash Fix (Closed) Base URL: https://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/PluginDebuggerGDB.cs » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/PluginDebuggerBase.cs
diff --git a/visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/PluginDebuggerBase.cs b/visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/PluginDebuggerBase.cs
index 595c2fa5eee3352e3e0a134148b9fa1baef55216..0d0e64b34cc96172104004accd9c2af1ac3a64eb 100644
--- a/visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/PluginDebuggerBase.cs
+++ b/visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/PluginDebuggerBase.cs
@@ -123,6 +123,8 @@ namespace NativeClientVSAddIn
/// <param name="unused1">The parameter is not used.</param>
public void FindAndAttachToPlugin(object unused, EventArgs unused1)
{
+ StringComparison ignoreCase = StringComparison.InvariantCultureIgnoreCase;
+
// This function is called by the main Visual Studio event loop and we may have put the event
// on the queue just before disposing it meaning this could be called after we've disposed.
if (Disposed)
@@ -130,8 +132,6 @@ namespace NativeClientVSAddIn
return;
}
- StringComparison ignoreCase = StringComparison.InvariantCultureIgnoreCase;
-
// Set the main chrome process that was started by visual studio. If it's not chrome
// or not found then we have no business attaching to any plug-ins so return.
if (debuggedChromeMainProcess_ == null)
@@ -148,10 +148,29 @@ namespace NativeClientVSAddIn
return;
}
+ if (debuggedChromeMainProcess_.HasExited)
+ {
+ // Might happen if we're shutting down debugging.
+ return;
+ }
+
// Get the list of all descendants of the main chrome process.
uint mainChromeProcId = (uint)debuggedChromeMainProcess_.Id;
List<ProcessInfo> chromeDescendants = processSearcher_.GetDescendants(mainChromeProcId);
- string mainChromeFlags = chromeDescendants.Find(p => p.ID == mainChromeProcId).CommandLine;
+ if (chromeDescendants.Count == 0)
+ {
+ // Might happen if we're shutting down debugging.
+ return;
+ }
+
+ ProcessInfo mainProcInfo = chromeDescendants.Find(p => p.ID == mainChromeProcId);
+ if (mainProcInfo == null)
+ {
+ // Might happen if we're shutting down debugging.
+ return;
+ }
+
+ string mainChromeFlags = mainProcInfo.CommandLine;
// From the list of descendants, find the plug-in by it's command line arguments and
// process name as well as not being attached to already.
« no previous file with comments | « no previous file | visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/PluginDebuggerGDB.cs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698