# HG changeset patch
# User l12wang
# Date 1259800069 21600
# Node ID d94b9ba55bedc099e07649fb1db8182aa782b3dc
# Parent d2bbceb7cdeb2ebe09423e1590ca0ec663a52487
backed out all changes related to BreakpointsMediator and moved the new mediator into EDC to be an EDC-specific service. Two problems solved here:
1. It will take some time for Pawel (and other DSF/GDB committers) to review and accept the big change to the mediator, namely the new mediator won't get into CDT repository for who knows how long. That would make EDC debugger in CDT repository a handicapped debugger (breakpoints not shown as resolved, disabled breakpoint still stops program, breakpoints in inline-function do not work well, etc).
2. All mediator related change is kept in our local CDT repository, which makes Ken's life harder when he tries to sync it with upstream.
diff -r d2bbceb7cdeb -r d94b9ba55bed cdt/cdt_6_0_x/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointAttributeTranslator.java
--- a/cdt/cdt_6_0_x/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointAttributeTranslator.java Wed Dec 02 09:47:49 2009 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,561 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Nokia and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nokia - Initial API and implementation. Nov, 2009.
- *******************************************************************************/
-package org.eclipse.cdt.dsf.mi.service;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.cdt.debug.core.model.ICBreakpoint;
-import org.eclipse.cdt.debug.core.model.ICBreakpointExtension;
-import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
-import org.eclipse.cdt.debug.core.model.ICWatchpoint;
-import org.eclipse.cdt.debug.internal.core.breakpoints.BreakpointProblems;
-import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
-import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
-import org.eclipse.cdt.dsf.datamodel.DMContexts;
-import org.eclipse.cdt.dsf.debug.service.BreakpointsMediator;
-import org.eclipse.cdt.dsf.debug.service.IBreakpointAttributeTranslatorExtension;
-import org.eclipse.cdt.dsf.debug.service.IDsfBreakpointExtension;
-import org.eclipse.cdt.dsf.debug.service.ISourceLookup;
-import org.eclipse.cdt.dsf.debug.service.BreakpointsMediator.BreakpointEventType;
-import org.eclipse.cdt.dsf.debug.service.BreakpointsMediator.ITargetBreakpointInfo;
-import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointDMContext;
-import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContext;
-import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext;
-import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext;
-import org.eclipse.cdt.dsf.debug.service.ISourceLookup.ISourceLookupDMContext;
-import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
-import org.eclipse.cdt.dsf.service.DsfServicesTracker;
-import org.eclipse.cdt.dsf.service.DsfSession;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IBreakpoint;
-
-public class MIBreakpointAttributeTranslator implements IBreakpointAttributeTranslatorExtension {
-
- private final static String GDB_DEBUG_MODEL_ID = "org.eclipse.cdt.dsf.gdb"; //$NON-NLS-1$
-
- // Extra breakpoint attributes
- private static final String ATTR_DEBUGGER_PATH = GdbPlugin.PLUGIN_ID + ".debuggerPath"; //$NON-NLS-1$
- private static final String ATTR_THREAD_FILTER = GdbPlugin.PLUGIN_ID + ".threadFilter"; //$NON-NLS-1$
-// private static final String ATTR_THREAD_ID = GdbPlugin.PLUGIN_ID + ".threadID"; //$NON-NLS-1$
-
- private DsfServicesTracker dsfServicesTracker;
- private DsfSession dsfSession;
- private BreakpointsMediator breakpointsMediator;
- private String debugModelId;
-
- /**
- * Manage breakpoint problem markers.
- * It's better be done by MIBreakpoints service so that it's accessible by
- * the MIBreakpoints service too. But to minimize change to MIBreakpoints in
- * this iteration, I just put it here..... 11/18/09
- */
- private Map fBreakpointMarkerProblems =
- new HashMap();
-
- public MIBreakpointAttributeTranslator(DsfSession dsfSession, String debugModelId) {
- super();
- this.dsfSession = dsfSession;
- this.debugModelId = debugModelId;
-
- dsfServicesTracker = new DsfServicesTracker(GdbPlugin.getDefault().getBundle().getBundleContext(), dsfSession.getId());
- }
-
- public boolean canUpdateAttributes(IBreakpointDMContext bp, Map delta) {
- /*
- * This method decides whether we need to re-install the breakpoint
- * based on the attributes change (refer to caller in
- * BreakpointsMediator).
- */
- // Check if there is any modified attribute
- if (delta == null || delta.size() == 0)
- return true;
-
- // Check the "critical" attributes
- if (delta.containsKey(ATTR_DEBUGGER_PATH) // File name
- || delta.containsKey(MIBreakpoints.LINE_NUMBER) // Line number
- || delta.containsKey(MIBreakpoints.FUNCTION) // Function name
- || delta.containsKey(MIBreakpoints.ADDRESS) // Absolute address
- || delta.containsKey(ATTR_THREAD_FILTER) // Thread ID
- || delta.containsKey(MIBreakpoints.EXPRESSION) // Watchpoint expression
- || delta.containsKey(MIBreakpoints.READ) // Watchpoint type
- || delta.containsKey(MIBreakpoints.WRITE)) { // Watchpoint type
- return false;
- }
-
- // for other attrs (ICBreakpoint.INSTALL_COUNT, ICBreakpoint.IGNORE_COUNT,
- // ICBreakpoint.CONDITION, etc), we can update them.
- return true;
- }
-
- public void dispose() {
- if (dsfServicesTracker != null)
- dsfServicesTracker.dispose();
- dsfSession = null;
-
- clearBreakpointProblemMarkers();
- }
-
- public List