Application of Vs2013 in Linux development (31): Memory block display

Source: Internet
Author: User

Happy Shrimp

http://blog.csdn.net/lights_joy/

Welcome reprint, but please keep the author information


to implement the display of memory blocks, you need to implement IDebugMemoryBytes2 interface, similar to this:


    Class Ad7memorybytes:idebugmemorybytes2    {        private ad7engine _engine;        Public Ad7engine Engine {get {return _engine;}}        Public ad7memorybytes (Ad7engine engine)        {            _engine = engine;        }        public int GetSize (out ulong pqwsize)        {            throw new notimplementedexception ();        }        public int ReadAt (IDEBUGMEMORYCONTEXT2 pstartcontext, uint dwcount, byte[] rgbmemory, out uint pdwread, ref uint Pdwunread Able)        {            ad7memoryaddress addr = Pstartcontext as ad7memoryaddress;            Pdwread = dwcount;            pdwunreadable = 0;            return CONSTANTS.S_OK;        }        public int writeat (IDEBUGMEMORYCONTEXT2 pstartcontext, uint dwcount, byte[] rgbmemory)        {            throw new NotImplementedException ();        }

when VS when the memory window is displayed, it is called:

        The memory bytes as represented by the IDebugMemoryBytes2 object was for the program's image in memory and not any Memor Y//That is allocated when the program was         executed.        public int getmemorybytes (out IDebugMemoryBytes2 ppmemorybytes)        {            ppmemorybytes = new Ad7memorybytes (this);            return CONSTANTS.S_OK;        }

This only implements an empty interface, and does not implement the refresh of the actual memory value, but at this time it is possible to IDE see this effect in the following:


used in interfaces that read data gdb of the -data-read-memory after actually reading the data and populating it, it becomes this:



Get!






??

Application of Vs2013 in Linux development (31): Memory block display

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.