Application of Vs2013 in Linux development (27): Thread list

Source: Internet
Author: User

Happy Shrimp

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

Welcome reprint, but please keep the author information


when gdb loads the application and runs it, it detects the creation of the thread and notifies the SDMof the message as an event. Therefore, when an interrupt occurs,the SDM of VS will invoke our callback for each thread:

        Retrieves a list of the stack frames for this thread.  We currently call into the process and get the frames.        We might want to cache the frame info.            int Idebugthread2.enumframeinfo (enum_frameinfo_flags dwfieldspec, uint Nradix, out IEnumDebugFrameInfo2 enumobject) {                if (_debuggedthread.id = =-1) {enumobject = null;            return vsconstants.e_fail;            } ilist<pythonstackframe> stackframes = new list<pythonstackframe> ();            string info = _debuggedthread.process.execcommand ("-thread-select" + _debuggedthread.id.tostring ());            int depth = getstackinfodepth ();                for (int i = 0; i < depth; i++) {pythonstackframe frm = Getstackinfo (i);            Stackframes.add (frm);            } _debuggedthread.frames = StackFrames;            int numstackframes = Stackframes.count;            Frameinfo[] Frameinfoarray;Frameinfoarray = new Frameinfo[numstackframes]; for (int i = 0; i < numstackframes; i++) {Ad7stackframe frame = new Ad7stackframe (_engine, this, STACKF                Rames[i]); Frame.            Setframeinfo (Dwfieldspec, out frameinfoarray[i]);            } enumobject = new Ad7frameinfoenum (Frameinfoarray);        return VSCONSTANTS.S_OK; }
Here we fill in the stack information in this thread, and thenSDMFurther information will be queried for each layer of the stack, such as local variables, function parameters, etc., which are returned after the requirements of the interface.VSbelow you see the information for the thread list:


Double-click to view a list of the threads ' stacks:

One problem here is speed, when the threads are more ( -one), refreshed one at a time actually to be nearly 5seconds, it seems to need improvementgdbthe way the command is invoked.



??

Application of Vs2013 in Linux development (27): Thread list

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.