private void GoToAddress(string hexAddress)
 {
     if (int.TryParse(hexAddress, NumberStyles.HexNumber, null, out int address))
     {
         MemoryListView.SelectedItem = cells.First(c => c.Address == address);
         MemoryListView.ScrollIntoView(MemoryListView.SelectedItem);
     }
     else
     {
         MessageBox.Show("L'adresse 0x" + address.ToString("X4") + " n'a pas été trouvé !", "Erreur", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
Exemple #2
0
        private void CreateMemView()
        {
            PanelMemory = new BorderedPanel
            {
                Location = Dock_LeftBot,
                AutoSize = false,

                // For an unknown reason, the panel will resize slightly more than this value. It seems to become the size of the child control
                // plus an extra constant. This happens regardless of $AutoSize.
                Size = new Size(0x1a0, 383),
                Tag  = "Memory"
            };
            MemoryViewer = new MemoryListView(new Size(0x1d8, 383))
            {
                // This position is relative to the panel. A small offset makes sure that the
                // text and border will not be clipped over.
                Location = new Point(3, 16),
            };

            PanelMemory.Controls.Add(MemoryViewer);
            Controls.Add(PanelMemory);
        }
Exemple #3
0
        private void CmdDisplayStream(string streamName)
        {
            UserControl viewToDisplay = null;
            int         numberOfItems = 0;
            string      nodeText      = String.Empty; // Quick fix for duplicated item counts in node text

            switch (streamName)
            {
            case "Summary":
                nodeText      = string.Empty;
                viewToDisplay = new SummaryView(_miniDumpFile);
                break;

            case "Handles":
                nodeText = "Handles";
                MiniDumpHandleDescriptor[] handleData = this._miniDumpFile.ReadHandleData();
                numberOfItems = handleData.Length;
                viewToDisplay = new HandleDataView(handleData);
                break;

            case "Modules":
                nodeText = "Modules";
                MiniDumpModule[] moduleData = this._miniDumpFile.ReadModuleList();
                numberOfItems = moduleData.Length;
                viewToDisplay = new ModulesView(moduleData);
                break;

            case "Threads":
                nodeText = "Threads";
                MiniDumpThread[] threadData = this._miniDumpFile.ReadThreadList();
                numberOfItems = threadData.Length;
                viewToDisplay = new ThreadListView(threadData);
                break;

            case "ThreadInfo":
                nodeText = "ThreadInfo";
                MiniDumpThreadInfo[] threadInfoData = this._miniDumpFile.ReadThreadInfoList();
                numberOfItems = threadInfoData.Length;
                viewToDisplay = new ThreadInfoListView(threadInfoData);
                break;

            case "ThreadNames":
                nodeText = "ThreadNames";
                MiniDumpThreadNamesStream threadNamesStream = this._miniDumpFile.ReadThreadNamesStream();
                numberOfItems = threadNamesStream.Entries.Count;
                viewToDisplay = new ThreadNamesView(threadNamesStream);
                break;

            case "Memory":
                nodeText = "Memory";
                MiniDumpMemoryDescriptor[] memoryData = this._miniDumpFile.ReadMemoryList();
                numberOfItems = memoryData.Length;
                viewToDisplay = new MemoryListView(memoryData);
                break;

            case "Memory64":
                nodeText = "Memory64";
                MiniDumpMemory64Stream memory64Data = this._miniDumpFile.ReadMemory64List();
                numberOfItems = memory64Data.MemoryRanges.Length;
                viewToDisplay = new MemoryList64View(memory64Data.MemoryRanges);
                break;

            case "MemoryInfo":
                nodeText = "MemoryInfo";
                MiniDumpMemoryInfoStream memoryInfo = this._miniDumpFile.ReadMemoryInfoList();
                numberOfItems = memoryInfo.Entries.Length;
                viewToDisplay = new MemoryInfoView(memoryInfo, _miniDumpFile);
                break;

            case "MiscInfo":
                nodeText = "MiscInfo";
                MiniDumpMiscInfo miscInfo = this._miniDumpFile.ReadMiscInfo();
                numberOfItems = 1;
                viewToDisplay = new MiscInfoView(miscInfo);
                break;

            case "SystemInfo":
                nodeText = "SystemInfo";
                MiniDumpSystemInfoStream systemInfo = this._miniDumpFile.ReadSystemInfo();
                numberOfItems = 1;
                viewToDisplay = new SystemInfoView(systemInfo);
                break;

            case "Exception":
                nodeText = "Exception";
                MiniDumpExceptionStream exceptionStream = this._miniDumpFile.ReadExceptionStream();

                numberOfItems = (exceptionStream == null) ? 0 : 1;

                viewToDisplay = new ExceptionStreamView(exceptionStream);
                break;

            case "UnloadedModules":
                nodeText = "UnloadedModules";
                MiniDumpUnloadedModulesStream unloadedModulesStream = this._miniDumpFile.ReadUnloadedModuleList();
                numberOfItems = (int)unloadedModulesStream.NumberOfEntries;
                viewToDisplay = new UnloadedModulesView(unloadedModulesStream);
                break;

            case "SystemMemoryInfo":
                nodeText = "SystemMemoryInfo";
                MiniDumpSystemMemoryInfo systemMemoryInfo = this._miniDumpFile.ReadSystemMemoryInfo();
                numberOfItems = 1;
                viewToDisplay = new SystemMemoryInfoView(systemMemoryInfo);
                break;

            case "CommentW":
                nodeText = "CommentW";
                MiniDumpCommentStreamW commentWStream = this._miniDumpFile.ReadCommentStreamW();
                numberOfItems = string.IsNullOrEmpty(commentWStream.Comment) ? 0 : 1;
                viewToDisplay = new CommentStreamWView(commentWStream);
                break;
            }

            if (viewToDisplay != null)
            {
                if (nodeText != string.Empty)
                {
                    treeView1.SelectedNode.Text = nodeText + " (" + numberOfItems + (numberOfItems == 1 ? " item" : " items") + ")";
                }

                if (this.splitContainer1.Panel2.Controls.Count > 0)
                {
                    this.splitContainer1.Panel2.Controls.RemoveAt(0);
                }

                viewToDisplay.Dock = DockStyle.Fill;

                this.splitContainer1.Panel2.Controls.Add(viewToDisplay);
            }
        }