首页 > 编程语言 > 详细

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

时间:2015-09-17 11:38:16      阅读:228      评论: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/4815519.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!