Browse Source
Removed some eval events git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1655 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
10 changed files with 117 additions and 110 deletions
@ -0,0 +1,57 @@
@@ -0,0 +1,57 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
using Debugger.Wrappers.CorDebug; |
||||
|
||||
namespace Debugger |
||||
{ |
||||
public partial class Eval |
||||
{ |
||||
class NewObjectEval: Eval |
||||
{ |
||||
ICorDebugClass classToCreate; |
||||
|
||||
public NewObjectEval(NDebugger debugger, ICorDebugClass classToCreate):base(debugger, false, new IExpirable[] {}) |
||||
{ |
||||
this.classToCreate = classToCreate; |
||||
} |
||||
|
||||
internal override bool SetupEvaluation(Thread targetThread) |
||||
{ |
||||
debugger.AssertPaused(); |
||||
|
||||
if (targetThread.IsLastFunctionNative) { |
||||
OnError("Can not evaluate because native frame is on top of stack"); |
||||
return false; |
||||
} |
||||
|
||||
// TODO: What if this thread is not suitable?
|
||||
corEval = targetThread.CorThread.CreateEval(); |
||||
|
||||
try { |
||||
corEval.NewObjectNoConstructor(classToCreate); |
||||
} catch (COMException e) { |
||||
if ((uint)e.ErrorCode == 0x80131C26) { |
||||
OnError("Can not evaluate in optimized code"); |
||||
return false; |
||||
} else { |
||||
throw; |
||||
} |
||||
} |
||||
|
||||
EvalState = EvalState.Evaluating; |
||||
|
||||
return true; |
||||
} |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue