Exemplo n.º 1
0
            public override void OnAction(IMFDeployForm form, MFDevice device)
            {
                if (form == null || device == null)
                {
                    return;
                }

                _DBG.Engine engine = device.DbgEngine;

                _DBG.WireProtocol.Commands.Monitor_DeploymentMap.Reply reply = engine.DeploymentMap();

                if (reply != null)
                {
                    for (int i = 0; i < reply.m_count; i++)
                    {
                        _DBG.WireProtocol.Commands.Monitor_DeploymentMap.DeploymentData dd = reply.m_map[i];

                        form.DumpToOutput("Assembly " + i.ToString());
                        form.DumpToOutput("  Address: " + dd.m_address.ToString());
                        form.DumpToOutput("  Size   : " + dd.m_size.ToString());
                        form.DumpToOutput("  CRC    : " + dd.m_CRC.ToString());
                    }

                    if (reply.m_count == 0)
                    {
                        form.DumpToOutput("No deployed assemblies");
                    }
                }
                else
                {
                    form.DumpToOutput("Command Not Supported by Device");
                }
            }
        private void buttonDeployMap_Click(object sender, EventArgs e)
        {
            bool bWasStarted = EnsureDebuggerConnection();

            Microsoft.SPOT.Debugger.WireProtocol.Commands.Monitor_DeploymentMap.Reply deployMap = m_eng.DeploymentMap();
            if (deployMap != null)
            {
                NewText("Deployment Map\r\n");
                for (int i = 0; i < deployMap.m_count; i++)
                {
                    NewText("Assembly " + i.ToString() + ":\r\n");
                    NewText(string.Format("\tAddress: 0x{0:x}\r\n", deployMap.m_map[i].m_address));
                    NewText(string.Format("\tCRC:     0x{0:x}\r\n", deployMap.m_map[i].m_CRC));
                    NewText(string.Format("\tSize:    0x{0:x}\r\n", deployMap.m_map[i].m_size));
                }
                if (deployMap.m_count == 0)
                {
                    NewText("No assemblies in deployment sector\r\n");
                }
            }
            else
            {
                NewText("Nothing in deployment sector - or - deployment map not supported\r\n");
            }
            if (!bWasStarted)
            {
                m_eng.Stop();
                m_eng = null;
            }
        }