コード例 #1
0
        public void GoToDisassembly(DTE dte, String method, int offset)
        {
            Initialize(dte);
            if (s_treeview == null)
            {
                return;
            }

            // Make sure the windows are inti.alized
            DTE dteX5 = dte.Windows.Item(GuidBreakpoints).DTE;

            dte.Windows.Item(GuidDisassembly).Visible = dte.Windows.Item(GuidDisassembly).Visible;

            String address = GetAddress(method, offset);

            int         countBefore = s_treeview.Count;
            Breakpoints bps         = dte.Debugger.Breakpoints.Add("", "", 0, 0, "", dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue,
                                                                   "C#", "", 0, address, 0, dbgHitCountType.dbgHitCountTypeNone);
            int countAfter = s_treeview.Count;

            IntPtr selected;
            IntPtr foundItem;

            if (!FindBreakpoint(address, method, offset, out foundItem, out selected))
            {
                return;
            }

            s_treeview.Select(foundItem);

            dte.ExecuteCommand(MenuGoToDisassembly, "");

            if (countAfter > countBefore)
            {
                bps.Item(1).Delete();
            }

            s_treeview.Select(selected);

            dte.Windows.Item(GuidThreadStack).Activate();
            dte.Windows.Item(GuidDisassembly).Activate();
        }