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