Browse Source

fixed small, but annoying bugs in VB Lexer and profiler

pull/21/merge
Siegfried Pammer 14 years ago
parent
commit
cf9a06642b
  1. 4
      src/AddIns/Analysis/Profiler/Controller/Data/PerformanceCounterDescriptor.cs
  2. 3
      src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Lexer.cs

4
src/AddIns/Analysis/Profiler/Controller/Data/PerformanceCounterDescriptor.cs

@ -97,6 +97,7 @@ namespace ICSharpCode.Profiler.Controller.Data
/// </summary> /// </summary>
public static string GetProcessInstanceName(int pid) public static string GetProcessInstanceName(int pid)
{ {
try {
PerformanceCounterCategory cat = new PerformanceCounterCategory("Process"); PerformanceCounterCategory cat = new PerformanceCounterCategory("Process");
string[] instances = cat.GetInstanceNames(); string[] instances = cat.GetInstanceNames();
@ -107,6 +108,9 @@ namespace ICSharpCode.Profiler.Controller.Data
return instance; return instance;
} }
} }
} catch (Exception) {
return null;
}
return null; return null;
} }

3
src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Lexer.cs

@ -61,7 +61,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
char ch = (char)nextChar; char ch = (char)nextChar;
#region XML mode #region XML mode
CheckXMLState(startLocation); CheckXMLState(startLocation);
if (inXmlMode && xmlModeStack.Peek().level <= 0 && !xmlModeStack.Peek().isDocumentStart && !xmlModeStack.Peek().inXmlTag) { if (inXmlMode && xmlModeStack.Count > 0 && xmlModeStack.Peek().level <= 0 && !xmlModeStack.Peek().isDocumentStart && !xmlModeStack.Peek().inXmlTag) {
XmlModeInfo info = xmlModeStack.Peek(); XmlModeInfo info = xmlModeStack.Peek();
int peek = nextChar; int peek = nextChar;
while (true) { while (true) {
@ -361,6 +361,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
} }
} }
[Conditional("DEBUG")]
void CheckXMLState(Location startLocation) void CheckXMLState(Location startLocation)
{ {
if (inXmlMode && !xmlModeStack.Any()) if (inXmlMode && !xmlModeStack.Any())

Loading…
Cancel
Save