コード例 #1
0
        private AD7PendingBreakpoint BindToAddress(string bkptno, ulong addr, /*OPTIONAL*/ TupleValue frame, out AD7BoundBreakpoint bbp)
        {
            bbp = null;
            AD7PendingBreakpoint pending = CodeBreakpoints.FirstOrDefault((p) => { return(p.BreakpointId == bkptno); });

            if (pending == null)
            {
                return(null);
            }
            // the breakpoint number is known, check to see if it is known to be bound to this address
            bbp = Array.Find(pending.EnumBoundBreakpoints(), (b) => b.Addr == addr);
            if (bbp == null)
            {
                // add this address as a bound breakpoint
                bbp = Array.Find(pending.EnumBoundBreakpoints(), (b) => b.Addr == 0);
                if (bbp != null)    // <MULTIPLE>
                {
                    bbp.UpdateAddr(addr);
                }
                else
                {
                    bbp = pending.AddBoundBreakpoint(new BoundBreakpoint(pending.PendingBreakpoint, addr, frame));
                }
            }
            return(pending);
        }
コード例 #2
0
        public async Task BindAsync()
        {
            var breakpointsToBind = CodeBreakpoints.Where((b) => b.PendingBreakpoint != null && b.PendingBreakpoint.IsPending);

            if (breakpointsToBind != null)
            {
                foreach (var b in breakpointsToBind)
                {
                    var bpList = await b.PendingBreakpoint.SyncBreakpoint(_engine.DebuggedProcess);

                    RebindAddresses(b, bpList);
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// Handle a modified breakpoint event. Only handles address changes.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public async Task BreakpointModified(object sender, EventArgs args)
        {
            MICore.Debugger.ResultEventArgs res = args as MICore.Debugger.ResultEventArgs;
            MICore.ResultValue bkpt             = res.Results.Find("bkpt");
            string             bkptId           = null;

            //
            // =breakpoint-modified,
            //    bkpt ={number="2",type="breakpoint",disp="keep",enabled="y",addr="<MULTIPLE>",times="0",original-location="main.cpp:220"},
            //          { number="2.1",enabled="y",addr="0x9c2149a9",func="Foo::bar<int>(int)",file="main.cpp",fullname="C:\\\\...\\\\main.cpp",line="220",thread-groups=["i1"]},
            //          { number="2.2",enabled="y",addr="0x9c2149f2",func="Foo::bar<float>(float)",file="main.cpp",fullname="C:\\\\...\\\\main.cpp",line="220",thread-groups=["i1"]}
            // note: the ".x" part of the breakpoint number never appears in stopping events, that is, when executing at one of these addresses
            //       the stopping event delivered contains bkptno="2"
            if (bkpt is MICore.ValueListValue)
            {
                MICore.ValueListValue list = bkpt as MICore.ValueListValue;
                bkptId = list.Content[0].FindString("number"); // 0 is the "<MULTIPLE>" entry
            }
            else
            {
                bkptId = bkpt.FindString("number");
            }
            AD7PendingBreakpoint pending = CodeBreakpoints.FirstOrDefault((p) => { return(p.BreakpointId == bkptId); });

            if (pending == null)
            {
                return;
            }

            string warning = bkpt.TryFindString("warning");

            if (!string.IsNullOrEmpty(warning))
            {
                pending.SetError(new AD7ErrorBreakpoint(pending, warning), true);
            }
            else
            {
                var bindList = await pending.PendingBreakpoint.BindAddresses(bkpt);

                RebindAddresses(pending, bindList);
            }
        }