首页 > 代码库 > Vs2013在Linux开发中的应用(20): 断点设置

Vs2013在Linux开发中的应用(20): 断点设置


vs设置断点时,SDM将调用:


        // Creates a pending breakpoint in the engine. A pending breakpoint is contains all the information needed to bind a breakpoint to 
        // a location in the debuggee.
        int IDebugEngine2.CreatePendingBreakpoint(IDebugBreakpointRequest2 pBPRequest, out IDebugPendingBreakpoint2 ppPendingBP)

在此回调中,我们实现并填充IDebugPendingBreakpoint2接口:


            AD7PendingBreakpoint pendingBreakpoint = new AD7PendingBreakpoint(pBPRequest, m_engine, this);

            ppPendingBP= (IDebugPendingBreakpoint2)pendingBreakpoint;


但此时并不需要通知gdb设置断点。

接着SDM将调用

        // Binds this pending breakpoint to one or more codelocations.

        intIDebugPendingBreakpoint2.Bind() {

在这个回调函数中我们将通知gdb绑定断点(-break-insert命令),下面是gdb对命令的响应:

-break-insertrc.c:1564

^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0805fc75",func="main",file="../../app/rc/rc.c",fullname="/mnt/hgfs/nvs_dev/src/ipc/app/rc/rc.c",line="1564",times="0",original-location="rc.c:1564"}

gdb正常设置断点后,我们需要通知SDM断点绑定成功:

            Send(

                newAD7BreakpointBoundEvent((AD7PendingBreakpoint)pendingBreakpoint, boundBreakpoint),

                AD7BreakpointBoundEvent.IID,

                null

            );


 


??

Vs2013在Linux开发中的应用(20): 断点设置