Application of Vs2013 in Linux development (28): Single Step execution

Source: Internet
Author: User

Happy Shrimp

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

Welcome reprint, but please keep the author information

in theVSWhen debugging, there are three types of single-step action-by-statement, process-stepping and jumping-out, when doing these three operations,SDMThe call is actually the same callback:

This method is deprecated.        Use the Idebugprocess3::step method instead.         <summary>//Performs a step.  In case there are any thread synchronization or communication between threads, and other threads in the program        Should run when a particular thread is stepping.            </summary> public int Step (IDebugThread2 pThread, Enum_stepkind SK, Enum_stepunit step) {            if (_mixedmode) {return constants.e_notimpl; } var thread = ((Ad7thread) pThread).            Getdebuggedthread (); Switch (SK) {case Enum_stepkind. Step_into:thread. Stepinto ();                Break Case Enum_stepkind. Step_out:thread. StepOut ();                Break Case Enum_stepkind. Step_over:thread. Stepover ();            Break        } return CONSTANTS.S_OK; }

we convert it to gdb the command:

        internal void Sendstepout (long threadId) {            Debugwritecommand ("StepOut");            Execdone ("-exec-return");            var stepcomp = StepComplete;            Pythonthread TRD = _threads[threadid];            if (Stepcomp! = null)            {                Stepcomp (this, new Threadeventargs (TRD));}        }        internal void Sendstepover (long threadId) {            Debugwritecommand ("Stepover");            ExecCommand ("-exec-next");        }        internal void Sendstepinto (long threadId) {            Debugwritecommand ("Stepinto");            ExecCommand ("-exec-step");        }

gdb execute stepout is slightly different from the other two operations when executing stepout when

-exec-return

^done,frame={level= "0", func= "Callee3",

Args=[{name= "Strarg",

value= "0x11940 \" A string Argument.\ ""}],

File= ". /.. /.. /DEVO/GDB/TESTSUITE/GDB.MI/BASICS.C ",

Fullname= "/HOME/FOO/BAR/DEVO/GDB/TESTSUITE/GDB.MI/BASICS.C", line= "18"}

which means it directly outputs the ^done while the other two operations use the *stopped Information:

-exec-step

^running

(GDB)

*stopped,reason= "End-stepping-range", line= ", file=" recursive2.c "

The same thing is that event notifications must be sent at the end of these three operations SDM :

        private void Onstepcomplete (object sender, Threadeventargs e)        {            Send (new Ad7steppingcompleteevent (), AD7STEPPINGCOMPLETEEVENT.IID, _threads[e.thread]);        }

Get!

Now we can VS used in gdb do one step debugging!









??

Application of Vs2013 in Linux development (28): Single Step execution

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.