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())); } }
时间: 2024-10-31 04:56:59