Пример #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public DebuggeeBreakpointBound(DebugBreakpointManager breakpointManager, DebuggeeBreakpointPending pendingBreakpoint, DebuggeeCodeContext codeContext)
        {
            if (breakpointManager == null)
            {
                throw new ArgumentNullException("breakpointManager");
            }

            if (pendingBreakpoint == null)
            {
                throw new ArgumentNullException("pendingBreakpoint");
            }

            if (codeContext == null)
            {
                throw new ArgumentNullException("codeContext");
            }

            m_breakpointManager = breakpointManager;

            m_pendingBreakpoint = pendingBreakpoint;

            m_codeContext = codeContext;

            m_breakpointResolution = new DebuggeeBreakpointResolution(m_codeContext, "<bound breakpoint>");

            m_breakpointEnabled = true;

            m_breakpointDeleted = false;

            m_hitCount = 0;
        }
Пример #2
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public DebuggeeBreakpointError(DebugBreakpointManager breakpointManager, DebuggeeBreakpointPending pendingBreakpoint, DebuggeeCodeContext codeContext, string error)
        {
            if (breakpointManager == null)
            {
                throw new ArgumentNullException("breakpointManager");
            }

            if (pendingBreakpoint == null)
            {
                throw new ArgumentNullException("pendingBreakpoint");
            }

            if (codeContext == null)
            {
                throw new ArgumentNullException("codeContext");
            }

            m_breakpointManager = breakpointManager;

            m_pendingBreakpoint = pendingBreakpoint;

            m_codeContext = codeContext;

            m_breakpointResolution = new DebuggeeBreakpointResolution(m_codeContext, error);
        }
Пример #3
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public DebuggeeBreakpointError(DebugBreakpointManager breakpointManager, DebuggeeBreakpointPending pendingBreakpoint, DebuggeeCodeContext codeContext, string error)
        {
            m_breakpointManager = breakpointManager ?? throw new ArgumentNullException(nameof(breakpointManager));

            m_pendingBreakpoint = pendingBreakpoint ?? throw new ArgumentNullException(nameof(pendingBreakpoint));

            m_codeContext = codeContext ?? throw new ArgumentNullException(nameof(codeContext));

            m_breakpointResolution = new DebuggeeBreakpointResolution(m_codeContext, error);
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public DebuggeeBreakpointBound(DebugBreakpointManager breakpointManager, DebuggeeBreakpointPending pendingBreakpoint, DebuggeeCodeContext codeContext)
        {
            m_breakpointManager = breakpointManager ?? throw new ArgumentNullException(nameof(breakpointManager));

            m_pendingBreakpoint = pendingBreakpoint ?? throw new ArgumentNullException(nameof(pendingBreakpoint));

            m_codeContext = codeContext ?? throw new ArgumentNullException(nameof(codeContext));

            m_breakpointResolution = new DebuggeeBreakpointResolution(m_codeContext, "<bound breakpoint>");

            m_breakpointEnabled = true;

            m_breakpointDeleted = false;

            m_hitCount = 0;
        }
Пример #5
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public int CreatePendingBreakpoint(IDebugBreakpointRequest2 breakpointRequest, out IDebugPendingBreakpoint2 pendingBreakpoint)
        {
            //
            // Construct and register new pending breakpoint.
            //

            LoggingUtils.PrintFunction();

            try
            {
                DebuggeeBreakpointPending breakpoint = null;

                BP_REQUEST_INFO [] requestInfo = new BP_REQUEST_INFO [1];

                LoggingUtils.RequireOk(breakpointRequest.GetRequestInfo(enum_BPREQI_FIELDS.BPREQI_BPLOCATION, requestInfo));

                long locationType = requestInfo [0].bpLocation.bpLocationType & (long)enum_BP_LOCATION_TYPE.BPLT_LOCATION_TYPE_MASK;

                if ((locationType & (long)enum_BP_LOCATION_TYPE.BPLT_FILE_LINE) != 0)
                {
                    //
                    // Query the associated document extension, and create a respective pending breakpoint type.
                    //

                    IDebugDocumentPosition2 documentPostion = (IDebugDocumentPosition2)Marshal.GetObjectForIUnknown(requestInfo[0].bpLocation.unionmember2);

                    LoggingUtils.RequireOk(documentPostion.GetFileName(out string fileName));

                    string fileExtension = Path.GetExtension(fileName).ToLower();

                    switch (fileExtension)
                    {
                    case ".c":
                    case ".cpp":
                    case ".h":
                    case ".hpp":
                    case ".asm":
                    case ".inl":
                    {
                        breakpoint = new CLangDebuggeeBreakpointPending(Engine.NativeDebugger, this, breakpointRequest);

                        break;
                    }

                    case ".java":
                    {
                        throw new NotImplementedException();
                    }

                    default:
                    {
                        breakpoint = new DebuggeeBreakpointPending(this, breakpointRequest);

                        break;
                    }
                    }
                }
                else if ((locationType & (long)enum_BP_LOCATION_TYPE.BPLT_FUNC_OFFSET) != 0)
                {
                    throw new NotImplementedException();
                }
                else if ((locationType & (long)enum_BP_LOCATION_TYPE.BPLT_CONTEXT) != 0)
                {
                    throw new NotImplementedException();
                }
                else if ((locationType & (long)enum_BP_LOCATION_TYPE.BPLT_STRING) != 0)
                {
                    throw new NotImplementedException();
                }
                else if ((locationType & (long)enum_BP_LOCATION_TYPE.BPLT_ADDRESS) != 0)
                {
                    throw new NotImplementedException();
                }
                else if ((locationType & (long)enum_BP_LOCATION_TYPE.BPLT_RESOLUTION) != 0)
                {
                    throw new NotImplementedException();
                }
                else
                {
                    throw new NotImplementedException();
                }

                lock (m_pendingBreakpoints)
                {
                    m_pendingBreakpoints.Add(breakpoint);
                }

                pendingBreakpoint = (IDebugPendingBreakpoint2)breakpoint;

                SetDirty(true);

                return(Constants.S_OK);
            }
            catch (NotImplementedException e)
            {
                LoggingUtils.HandleException(e);

                pendingBreakpoint = null;

                return(Constants.E_NOTIMPL);
            }
            catch (Exception e)
            {
                LoggingUtils.HandleException(e);

                pendingBreakpoint = null;

                return(Constants.E_FAIL);
            }
        }
Пример #6
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public CLangDebuggeeBreakpointError(CLangDebugger debugger, DebugBreakpointManager breakpointManager, DebuggeeBreakpointPending pendingBreakpoint, DebuggeeCodeContext codeContext, MiBreakpoint gdbBreakpoint, string error)
            : base(breakpointManager, pendingBreakpoint, codeContext, error)
        {
            m_debugger = debugger;

            GdbBreakpoint = gdbBreakpoint;
        }
Пример #7
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public CLangDebuggeeBreakpointBound(CLangDebugger debugger, DebugBreakpointManager breakpointManager, DebuggeeBreakpointPending pendingBreakpoint, DebuggeeCodeContext codeContext, MiBreakpoint gdbBreakpoint)
            : base(breakpointManager, pendingBreakpoint, codeContext)
        {
            m_debugger = debugger;

            GdbBreakpoint = gdbBreakpoint;
        }