码迷,mamicode.com
首页 > 编程语言 > 详细

CDT源代码框架分析改造 线程对象的改造 添加标签 区分断点跟跟踪点

时间:2015-09-17 11:37:39      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:

cdt 到debug 通信路线

CBreakpointManager类中

 

protected void setBreakpointsOnTarget0( ICBreakpoint[] breakpoints )
{
//添加标示符 
                    
                    String pointtype =breakpoint.getPointType();
                    fileName = convertPath(fileName).toOSString();
                    ICDIFunctionLocation location = cdiTarget.createFunctionLocation( fileName, function );
                    ICDICondition condition = createCondition2( breakpoint );
                    fBreakpointProblems.add(BreakpointProblems.reportUnresolvedBreakpoint(breakpoint, getDebugTarget().getName(), getDebugTarget().getInternalID()));
                    if (bpManager2 != null)
                        cdiBreakpoint = bpManager2.setFunctionBreakpoint( location, condition, true,
                                breakpoints[i].isEnabled(), breakpoints[i].isTemporary(),breakpoint.getID(), symbolFile ,pointtype);
....
}

Target

 

    /****
     * wangmin 
     * add type is tracepoint
     * 
     */
    public ICDIFunctionBreakpoint setFunctionBreakpoint(ICDIFunctionLocation location,
            ICDICondition condition, boolean deferred, boolean enabled, boolean temp, String id, String symbolFilePath,String pointType) throws CDIException {
        BreakpointManager bMgr = ((Session)getSession()).getBreakpointManager();
        return bMgr.setFunctionBreakpoint(this, location, condition, deferred, enabled, temp, id, symbolFilePath, pointType);
    

}

breakpointManager

 

    /**
     * 
     * wangmin add type
     * @param target
     * @param location
     * @param condition
     * @param deferred
     * @param enabled
     * @param temp
     * @param id
     * @param symbolFilePath
     * @return
     * @throws CDIException
     */
    public ICDIFunctionBreakpoint setFunctionBreakpoint(Target target, ICDIFunctionLocation location,
            ICDICondition condition, boolean deferred, boolean enabled, boolean temp, String id, String symbolFilePath,String typePoint ) throws CDIException {
        FunctionBreakpoint bkpt = new FunctionBreakpoint(target, location, condition, enabled);
        //bkpt.setID(id);
        //duyingze 20080802 所有断点使用统一的id
        bkpt.setPointType(typePoint);
        bkpt.setBpID(id);
        bkpt.setSymbolFilePath(symbolFilePath);
        setNewLocationBreakpoint(bkpt, deferred);
        return bkpt;
    }

这里注意下 FunctionBreakpoint 是LocationBreakpoint的子类

同样是管理器中

调用mi。并且创建了一个MIBreakpointCreatedEvent事件。

 

 

    protected void setNewLocationBreakpoint(LocationBreakpoint bkpt, boolean deferred) throws CDIException {
        Target target = (Target)bkpt.getTarget();
        MISession miSession = target.getMISession();
        try {
            setLocationBreakpoint(bkpt);
            List blist = getBreakpointsList(target);
            blist.add(bkpt);

            // Fire a created Event.
            MIBreakpoint[] miBreakpoints = bkpt.getMIBreakpoints();
            if (miBreakpoints != null && miBreakpoints.length > 0) {
                miSession.fireEvent(new MIBreakpointCreatedEvent(miSession, miBreakpoints[0].getNumber()));
            }
        }

 

CDT源代码框架分析改造 线程对象的改造 添加标签 区分断点跟跟踪点

标签:

原文地址:http://www.cnblogs.com/codeGirl-wangMin/p/4815518.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!