本文整理汇总了C#中IDebugCodeContext2类的典型用法代码示例。如果您正苦于以下问题:C# IDebugCodeContext2类的具体用法?C# IDebugCodeContext2怎么用?C# IDebugCodeContext2使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IDebugCodeContext2类属于命名空间,在下文中一共展示了IDebugCodeContext2类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanSetNextStatement
public int CanSetNextStatement(IDebugStackFrame2 pStackFrame, IDebugCodeContext2 pCodeContext)
{
DLog.Debug(DContext.VSDebuggerComCall, "IDebugThread2.CanSetNextStatement");
var stack = (DebugStackFrame)pStackFrame;
var ctx = (DebugCodeContext)pCodeContext;
if (stack == null || ctx == null)
return VSConstants.E_FAIL;
if (ctx.Location.Equals(stack.Location))
return VSConstants.S_OK;
if (!ctx.Location.IsSameMethod(stack.Location))
return HResults.E_CANNOT_SETIP_TO_DIFFERENT_FUNCTION;
// for now, only allow to set the position above the current position.
if(ctx.Location.Index >= stack.Location.Index)
return VSConstants.E_FAIL;
// don't check existence of special code, so that we can produce a warning
// below.
//var loc = stack.GetDocumentLocationAsync().Await(DalvikProcess.VmTimeout);
//if (loc.Document == null)
// return VSConstants.E_FAIL;
return VSConstants.S_OK;
}
示例2: AD7DisassemblyStream
internal AD7DisassemblyStream(AD7Engine engine, enum_DISASSEMBLY_STREAM_SCOPE scope, IDebugCodeContext2 pCodeContext)
{
_engine = engine;
_scope = scope;
AD7MemoryAddress addr = pCodeContext as AD7MemoryAddress;
_addr = addr.Address;
}
示例3: GetCodeContext
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public int GetCodeContext (ulong uCodeLocationId, out IDebugCodeContext2 ppCodeContext)
{
//
// Returns a code context object corresponding to a specified code location identifier.
//
LoggingUtils.PrintFunction ();
try
{
string location = string.Format ("0x{0:X8}", uCodeLocationId);
ppCodeContext = CLangDebuggeeCodeContext.GetCodeContextForLocation (m_debugger, location);
if (ppCodeContext == null)
{
throw new InvalidOperationException ();
}
return Constants.S_OK;
}
catch (Exception e)
{
LoggingUtils.HandleException (e);
ppCodeContext = null;
return Constants.E_FAIL;
}
}
示例4: CLangDebuggeeDisassemblyStream
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public CLangDebuggeeDisassemblyStream (CLangDebugger debugger, enum_DISASSEMBLY_STREAM_SCOPE streamScope, IDebugCodeContext2 codeContext)
{
m_debugger = debugger;
m_streamScope = streamScope;
m_codeContext = codeContext as DebuggeeCodeContext;
}
示例5: GetCodeContext
/// <summary>
/// Returns a code context object corresponding to a specified code location identifier.
/// </summary>
/// <param name="uCodeLocationId">
/// [in] Specifies the code location identifier. See the Remarks section for the
/// IDebugDisassemblyStream2.GetCodeLocationId method for a description of a code location identifier.
/// </param>
/// <param name="ppCodeContext">[out] Returns an IDebugCodeContext2 object that represents the associated code context.</param>
/// <returns>If successful, returns S_OK; otherwise, returns an error code.</returns>
/// <remarks>
/// The code location identifier can be returned from a call to the IDebugDisassemblyStream2.GetCurrentLocation
/// method and can appear in the DisassemblyData structure.
///
/// To convert a code context into a code location identifier, call the IDebugDisassemblyStream2.GetCodeLocationId
/// method.
/// </remarks>
public int GetCodeContext(ulong uCodeLocationId, out IDebugCodeContext2 ppCodeContext)
{
ppCodeContext = null;
if (uCodeLocationId > (uint)_bytecode.Length)
return VSConstants.E_INVALIDARG;
ppCodeContext = new JavaDebugCodeContext(_executionContext.Program, _executionContext.Location.GetMethod().GetLocationOfCodeIndex((long)uCodeLocationId));
return VSConstants.S_OK;
}
示例6: BreakpointResolutionLocationCode
public BreakpointResolutionLocationCode(BP_RESOLUTION_LOCATION location, bool releaseComObjects)
{
if (location.bpType != (uint)enum_BP_TYPE.BPT_CODE)
throw new ArgumentException();
try
{
if (location.unionmember1 != IntPtr.Zero)
_codeContext = Marshal.GetObjectForIUnknown(location.unionmember1) as IDebugCodeContext2;
}
finally
{
if (releaseComObjects && location.unionmember1 != IntPtr.Zero)
Marshal.Release(location.unionmember1);
}
}
示例7: BreakpointLocationCodeContext
public BreakpointLocationCodeContext(BP_LOCATION location, bool releaseComObjects)
{
Contract.Requires<ArgumentException>((enum_BP_LOCATION_TYPE)location.bpLocationType == enum_BP_LOCATION_TYPE.BPLT_CODE_CONTEXT);
try
{
if (location.unionmember1 != IntPtr.Zero)
_codeContext = Marshal.GetObjectForIUnknown(location.unionmember2) as IDebugCodeContext2;
}
finally
{
if (releaseComObjects)
{
if (location.unionmember1 != IntPtr.Zero)
Marshal.Release(location.unionmember1);
}
}
}
示例8: GetCodeContext
public int GetCodeContext(ulong uCodeLocationId, out IDebugCodeContext2 ppCodeContext)
{
ppCodeContext = null;
if (_method == null)
return HResults.E_DISASM_NOTAVAILABLE;
var location = _loc.Location.GetAtIndex((uint)uCodeLocationId);
var ctx = new DebugCodeContext(location);
// try to set source code.
var source = _method.FindSourceCode((int)uCodeLocationId);
if(source != null)
{
var docLoc = new DocumentLocation(location, source, _loc.ReferenceType, _loc.Method, _method.TypeEntry, _method.MethodEntry);
ctx.DocumentContext = new DebugDocumentContext(docLoc, ctx);
}
ppCodeContext = ctx;
return VSConstants.S_OK;
}
示例9: SetNextStatement
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public override int SetNextStatement (IDebugStackFrame2 stackFrame, IDebugCodeContext2 codeContext)
{
//
// Sets the next statement to the given stack frame and code context.
//
LoggingUtils.PrintFunction ();
try
{
throw new NotImplementedException ();
return Constants.S_OK;
}
catch (Exception e)
{
LoggingUtils.HandleException (e);
return Constants.E_FAIL;
}
}
示例10:
// Determines whether the next statement can be set to the given stack frame and code context.
int IDebugThread2.CanSetNextStatement(IDebugStackFrame2 stackFrame, IDebugCodeContext2 codeContext)
{
// CLRDBG TODO: This implementation should be changed to compare the method token
ulong addr = ((AD7MemoryAddress)codeContext).Address;
AD7StackFrame frame = ((AD7StackFrame)stackFrame);
if (frame.ThreadContext.Level != 0 || frame.Thread != this || !frame.ThreadContext.pc.HasValue || _engine.DebuggedProcess.MICommandFactory.Mode == MIMode.Clrdbg)
{
return Constants.S_FALSE;
}
if (addr == frame.ThreadContext.pc)
{
return Constants.S_OK;
}
string toFunc = EngineUtils.GetAddressDescription(_engine.DebuggedProcess, addr);
string fromFunc = EngineUtils.GetAddressDescription(_engine.DebuggedProcess, frame.ThreadContext.pc.Value);
if (toFunc != fromFunc)
{
return Constants.S_FALSE;
}
return Constants.S_OK;
}
示例11: GetCodeContext
public int GetCodeContext(out IDebugCodeContext2 ppCodeCxt)
{
ppCodeCxt = docContext;
return VSConstants.S_OK;
}
示例12: ThrowIfDisposed
int IDebugThread2.CanSetNextStatement(IDebugStackFrame2 pStackFrame, IDebugCodeContext2 pCodeContext) {
ThrowIfDisposed();
return VSConstants.S_FALSE;
}
示例13: GetDisassemblyStream
public int GetDisassemblyStream(enum_DISASSEMBLY_STREAM_SCOPE dwScope, IDebugCodeContext2 pCodeContext, out IDebugDisassemblyStream2 ppDisassemblyStream) {
throw new NotImplementedException();
}
示例14:
int IDebugThread2.SetNextStatement(IDebugStackFrame2 pStackFrame, IDebugCodeContext2 pCodeContext) {
return VSConstants.E_NOTIMPL;
}
示例15:
int Microsoft.VisualStudio.Debugger.Interop.IDebugProgram2.GetDisassemblyStream(uint dwScope, IDebugCodeContext2 pCodeContext, out IDebugDisassemblyStream2 ppDisassemblyStream)
{
ppDisassemblyStream = null;
return Utility.COM_HResults.S_OK;
}