コード例 #1
0
ファイル: AD7StackFrame.cs プロジェクト: jda808/NPL
        public AD7StackFrame(AD7Engine engine, AD7Thread thread, X86ThreadContext threadContext)
        {
            m_engine = engine;
            m_thread = thread;
            m_threadContext = threadContext;

            // Try to get source information for this location. If symbols for this file have not been found, this will fail.
            m_hasSource = m_engine.DebuggedProcess.GetSourceInformation(
                                                            m_threadContext.eip,
                                                            ref m_documentName,
                                                            ref m_functionName,
                                                            ref m_lineNum,
                                                            ref m_numParameters,
                                                            ref m_numLocals);

            // If source information is available, create the collections of locals and parameters and populate them with
            // values from the debuggee.
            if (m_hasSource)
            {
                if (m_numParameters > 0)
                {
                    m_parameters = new VariableInformation[m_numParameters];
                    m_engine.DebuggedProcess.GetFunctionArgumentsByIP(m_threadContext.eip, m_threadContext.ebp, m_parameters);
                }

                if (m_numLocals > 0)
                {
                    m_locals = new VariableInformation[m_numLocals];
                    m_engine.DebuggedProcess.GetFunctionLocalsByIP(m_threadContext.eip, m_threadContext.ebp, m_locals);
                }
            }
        }
コード例 #2
0
ファイル: AD7BoundBreakpoint.cs プロジェクト: modulexcite/NPL
 public AD7BoundBreakpoint(AD7Engine engine, uint address, AD7PendingBreakpoint pendingBreakpoint, AD7BreakpointResolution breakpointResolution)
 {
     m_engine = engine;
     m_address = address;
     m_pendingBreakpoint = pendingBreakpoint;
     m_breakpointResolution = breakpointResolution;
     m_enabled = true;
     m_deleted = false;
 }
コード例 #3
0
        public AD7PendingBreakpoint(IDebugBreakpointRequest2 pBPRequest, AD7Engine engine, BreakpointManager bpManager)
        {
            m_pBPRequest = pBPRequest;
            BP_REQUEST_INFO[] requestInfo = new BP_REQUEST_INFO[1];
            EngineUtils.CheckOk(m_pBPRequest.GetRequestInfo(enum_BPREQI_FIELDS.BPREQI_BPLOCATION, requestInfo));
            m_bpRequestInfo = requestInfo[0];

            m_engine           = engine;
            m_bpManager        = bpManager;
            m_boundBreakpoints = new System.Collections.Generic.List <AD7BoundBreakpoint>();

            m_enabled = true;
            m_deleted = false;
        }
コード例 #4
0
ファイル: AD7PendingBreakpoint.cs プロジェクト: jda808/NPL
        public AD7PendingBreakpoint(IDebugBreakpointRequest2 pBPRequest, AD7Engine engine, BreakpointManager bpManager)
        {
            m_pBPRequest = pBPRequest;
            BP_REQUEST_INFO[] requestInfo = new BP_REQUEST_INFO[1];
            EngineUtils.CheckOk(m_pBPRequest.GetRequestInfo(enum_BPREQI_FIELDS.BPREQI_BPLOCATION, requestInfo));
            m_bpRequestInfo = requestInfo[0];

            m_engine = engine;
            m_bpManager = bpManager;
            m_boundBreakpoints = new System.Collections.Generic.List<AD7BoundBreakpoint>();

            m_enabled = true;
            m_deleted = false;
        }
コード例 #5
0
        public AD7StackFrame(AD7Engine engine, AD7Thread thread, X86ThreadContext threadContext)
        {
            m_engine        = engine;
            m_thread        = thread;
            m_threadContext = threadContext;

            // Try to get source information for this location. If symbols for this file have not been found, this will fail.
            m_hasSource = m_engine.DebuggedProcess.GetSourceInformation(
                m_threadContext.eip,
                ref m_documentName,
                ref m_functionName,
                ref m_lineNum,
                ref m_numParameters,
                ref m_numLocals);
            if (!String.IsNullOrEmpty(threadContext.sName))
            {
                m_functionName = string.Format("{0} in function {1}()", m_functionName, threadContext.sName);
            }

            // If source information is available, create the collections of locals and parameters and populate them with
            // values from the debuggee.
            if (m_hasSource)
            {
                if (m_numParameters > 0)
                {
                    m_parameters = new VariableInformation[m_numParameters];
                    m_engine.DebuggedProcess.GetFunctionArgumentsByIP(m_threadContext.eip, m_threadContext.ebp, m_parameters);
                }

                if (m_numLocals > 0)
                {
                    m_locals = new VariableInformation[m_numLocals];
                    m_engine.DebuggedProcess.GetFunctionLocalsByIP(m_threadContext.eip, m_threadContext.ebp, m_locals);
                }
            }
        }
コード例 #6
0
ファイル: BreakpointManager.cs プロジェクト: jda808/NPL
 public BreakpointManager(AD7Engine engine)
 {
     m_engine = engine;
     m_pendingBreakpoints = new System.Collections.Generic.List<AD7PendingBreakpoint>();
 }
コード例 #7
0
 public AD7Thread(AD7Engine engine, DebuggedThread debuggedThread)
 {
     m_engine         = engine;
     m_debuggedThread = debuggedThread;
 }
コード例 #8
0
ファイル: AD7Thread.cs プロジェクト: jda808/NPL
 public AD7Thread(AD7Engine engine, DebuggedThread debuggedThread)
 {
     m_engine = engine;
     m_debuggedThread = debuggedThread;
 }
コード例 #9
0
ファイル: AD7MemoryAddress.cs プロジェクト: jda808/NPL
 public AD7MemoryAddress(AD7Engine engine, uint address)
 {
     m_engine = engine;
     m_address = address;
 }
コード例 #10
0
 public EngineCallback(AD7Engine engine, IDebugEventCallback2 ad7Callback)
 {
     m_ad7Callback = ad7Callback;
     m_engine      = engine;
 }
コード例 #11
0
ファイル: AD7Events.cs プロジェクト: jda808/NPL
 internal static void Send(AD7Engine engine)
 {
     AD7ProgramCreateEvent eventObject = new AD7ProgramCreateEvent();
     engine.Callback.Send(eventObject, IID, null);
 }
コード例 #12
0
ファイル: EngineCallback.cs プロジェクト: jda808/NPL
 public EngineCallback(AD7Engine engine, IDebugEventCallback2 ad7Callback)
 {
     m_ad7Callback = ad7Callback;
     m_engine = engine;
 }
コード例 #13
0
ファイル: AD7BreakpointResolution.cs プロジェクト: jda808/NPL
 public AD7BreakpointResolution(AD7Engine engine, uint address, AD7DocumentContext documentContext)
 {
     m_engine = engine;
     m_address = address;
     m_documentContext = documentContext;
 }
コード例 #14
0
 public AD7MemoryAddress(AD7Engine engine, uint address)
 {
     m_engine  = engine;
     m_address = address;
 }
コード例 #15
0
        internal static void Send(AD7Engine engine)
        {
            AD7ProgramCreateEvent eventObject = new AD7ProgramCreateEvent();

            engine.Callback.Send(eventObject, IID, null);
        }
コード例 #16
0
        public static void Send(AD7Engine engine)
        {
            AD7EngineCreateEvent eventObject = new AD7EngineCreateEvent(engine);

            engine.Callback.Send(eventObject, IID, null, null);
        }
コード例 #17
0
 AD7EngineCreateEvent(AD7Engine engine)
 {
     m_engine = engine;
 }
コード例 #18
0
 public BreakpointManager(AD7Engine engine)
 {
     m_engine             = engine;
     m_pendingBreakpoints = new System.Collections.Generic.List <AD7PendingBreakpoint>();
 }
コード例 #19
0
        // Compares the memory context to each context in the given array in the manner indicated by compare flags,
        // returning an index of the first context that matches.
        public int Compare(enum_CONTEXT_COMPARE uContextCompare, IDebugMemoryContext2[] compareToItems, uint compareToLength, out uint foundIndex)
        {
            foundIndex = uint.MaxValue;

            try
            {
                enum_CONTEXT_COMPARE contextCompare = (enum_CONTEXT_COMPARE)uContextCompare;

                for (uint c = 0; c < compareToLength; c++)
                {
                    AD7MemoryAddress compareTo = compareToItems[c] as AD7MemoryAddress;
                    if (compareTo == null)
                    {
                        continue;
                    }

                    if (!AD7Engine.ReferenceEquals(this.m_engine, compareTo.m_engine))
                    {
                        continue;
                    }

                    bool result;

                    switch (contextCompare)
                    {
                    case enum_CONTEXT_COMPARE.CONTEXT_EQUAL:
                        result = (this.m_address == compareTo.m_address);
                        break;

                    case enum_CONTEXT_COMPARE.CONTEXT_LESS_THAN:
                        result = (this.m_address < compareTo.m_address);
                        break;

                    case enum_CONTEXT_COMPARE.CONTEXT_GREATER_THAN:
                        result = (this.m_address > compareTo.m_address);
                        break;

                    case enum_CONTEXT_COMPARE.CONTEXT_LESS_THAN_OR_EQUAL:
                        result = (this.m_address <= compareTo.m_address);
                        break;

                    case enum_CONTEXT_COMPARE.CONTEXT_GREATER_THAN_OR_EQUAL:
                        result = (this.m_address >= compareTo.m_address);
                        break;

                    // The sample debug engine doesn't understand scopes or functions
                    case enum_CONTEXT_COMPARE.CONTEXT_SAME_SCOPE:
                    case enum_CONTEXT_COMPARE.CONTEXT_SAME_FUNCTION:
                        result = (this.m_address == compareTo.m_address);
                        break;

                    case enum_CONTEXT_COMPARE.CONTEXT_SAME_MODULE:
                        result = (this.m_address == compareTo.m_address);
                        if (result == false)
                        {
                            DebuggedModule module = m_engine.DebuggedProcess.ResolveAddress(m_address);

                            if (module != null)
                            {
                                result = (compareTo.m_address >= module.BaseAddress) &&
                                         (compareTo.m_address < module.BaseAddress + module.Size);
                            }
                        }
                        break;

                    case enum_CONTEXT_COMPARE.CONTEXT_SAME_PROCESS:
                        result = true;
                        break;

                    default:
                        // A new comparison was invented that we don't support
                        return(Constants.E_NOTIMPL);
                    }

                    if (result)
                    {
                        foundIndex = c;
                        return(Constants.S_OK);
                    }
                }

                return(Constants.S_FALSE);
            }
            catch (ComponentException e)
            {
                return(e.HResult);
            }
            catch (Exception e)
            {
                return(EngineUtils.UnexpectedException(e));
            }
        }
コード例 #20
0
ファイル: AD7Events.cs プロジェクト: jda808/NPL
 AD7EngineCreateEvent(AD7Engine engine)
 {
     m_engine = engine;
 }
コード例 #21
0
 public AD7BreakpointResolution(AD7Engine engine, uint address, AD7DocumentContext documentContext)
 {
     m_engine          = engine;
     m_address         = address;
     m_documentContext = documentContext;
 }
コード例 #22
0
ファイル: AD7Events.cs プロジェクト: jda808/NPL
 public static void Send(AD7Engine engine)
 {
     AD7EngineCreateEvent eventObject = new AD7EngineCreateEvent(engine);
     engine.Callback.Send(eventObject, IID, null, null);
 }