cdt/cdt_6_0_x/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IBreakpointAttributeTranslatorExtension.java
changeset 112 6b1088abccf8
child 117 09f3d307f081
equal deleted inserted replaced
111:c2563c416525 112:6b1088abccf8
       
     1 /*******************************************************************************
       
     2  * Copyright (c) 2008 Wind River Systems and others.
       
     3  * All rights reserved. This program and the accompanying materials
       
     4  * are made available under the terms of the Eclipse Public License v1.0
       
     5  * which accompanies this distribution, and is available at
       
     6  * http://www.eclipse.org/legal/epl-v10.html
       
     7  * 
       
     8  * Contributors:
       
     9  *     Wind River Systems - initial API and implementation
       
    10  *******************************************************************************/
       
    11 package org.eclipse.cdt.dsf.debug.service;
       
    12 
       
    13 import java.util.List;
       
    14 import java.util.Map;
       
    15 
       
    16 import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
       
    17 import org.eclipse.cdt.dsf.concurrent.ThreadSafeAndProhibitedFromDsfExecutor;
       
    18 import org.eclipse.cdt.dsf.debug.service.BreakpointsMediator.BreakpointEventType;
       
    19 import org.eclipse.cdt.dsf.debug.service.BreakpointsMediator.ITargetBreakpointInfo;
       
    20 import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContext;
       
    21 import org.eclipse.core.runtime.CoreException;
       
    22 import org.eclipse.debug.core.model.IBreakpoint;
       
    23 
       
    24 /**
       
    25  * Breakpoint attribute translator interface
       
    26  * 
       
    27  * @since 2.1
       
    28  */
       
    29 
       
    30 @ThreadSafeAndProhibitedFromDsfExecutor("")
       
    31 public interface IBreakpointAttributeTranslatorExtension extends IBreakpointAttributeTranslator {
       
    32 	/**
       
    33 	 * Convert all attributes of the given platform breakpoint (BP) to
       
    34 	 * attributes of potential target breakpoints. Two tasks are involved:<br>
       
    35 	 * 1. Convert the attributes to debugger specific ones, if needed. For
       
    36 	 * instance, GDB implementation has its own breakpoint attribute keys. <br>
       
    37 	 * 2. Resolve the breakpoint. A platform BP may be mapped to two or more
       
    38 	 * target BPs, e.g. a breakpoint in an in-line function may be mapped to
       
    39 	 * several target BPs, or a thread-specific BP may be mapped to several
       
    40 	 * target BPs each of which is for one thread. This method will return an
       
    41 	 * attribute map for each of the target BP.<br>
       
    42 	 * <br>
       
    43 	 * This method must be called in DSF execution thread.
       
    44 	 * 
       
    45 	 * @param context
       
    46 	 *            - a IBreakpointsTargetDMContext object (which could be a
       
    47 	 *            process or a loaded module) in which we locate target BPs for
       
    48 	 *            the platform BP.
       
    49 	 * @param breakpoint
       
    50 	 *            - platform breakpoint.
       
    51 	 * @param bpManagerEnabled
       
    52 	 *            - flag from platform breakpoint manager indicating that all
       
    53 	 *            breakpoints are enabled.
       
    54 	 * @param drm
       
    55 	 *            - on completion of the request, the DataRequestMonitor
       
    56 	 *            contains one or more attribute maps each of which
       
    57 	 *            corresponding to one target breakpoint.
       
    58 	 * @throws CoreException
       
    59 	 */
       
    60     public void getTargetBreakpointAttributes(IBreakpointsTargetDMContext context, IBreakpoint breakpoint, 
       
    61     		boolean bpManagerEnabled, DataRequestMonitor<List<Map<String, Object>>> drm);
       
    62 
       
    63     /**
       
    64      * Convert platform breakpoint attributes to target-recognizable attributes. 
       
    65      * This method does not perform task #2 done by {@link this#getTargetBreakpointAttributes(List, IBreakpoint, boolean)}.
       
    66      * 
       
    67      * @param platformBPAttrDelta
       
    68      * @return
       
    69      */
       
    70     public Map<String, Object> convertAttributeDelta(Map<String, Object> platformBPAttrDelta);
       
    71         
       
    72     /**
       
    73      * Update platform about breakpoint status change, e.g. breakpoint installed on target successfully or breakpoint
       
    74      * removed from target successfully.
       
    75      *  
       
    76      * @param bpsInfo
       
    77      * @param eventType
       
    78      */
       
    79     public void updateBreakpointsStatus(Map<IBreakpoint, Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]>> bpsInfo, BreakpointEventType eventType);
       
    80 }