mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
[301720] Deal with the fact that on MacOS there is not CLI "New Thread" event, so we must clear our cache on a stopped event.
This commit is contained in:
parent
b76048e02f
commit
3c981baad1
2 changed files with 75 additions and 0 deletions
|
@ -0,0 +1,69 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2010 Ericsson 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:
|
||||
* Ericsson - initial API and implementation
|
||||
* Marc-Andre Laperle - fix for bug 269838
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.dsf.gdb.service.macos;
|
||||
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
|
||||
import org.eclipse.cdt.dsf.debug.service.IProcesses;
|
||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.ISuspendedDMEvent;
|
||||
import org.eclipse.cdt.dsf.gdb.service.GDBProcesses;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIProcesses;
|
||||
import org.eclipse.cdt.dsf.mi.service.MIProcesses;
|
||||
import org.eclipse.cdt.dsf.service.DsfServiceEventHandler;
|
||||
import org.eclipse.cdt.dsf.service.DsfSession;
|
||||
|
||||
/** @since 2.1 */
|
||||
public class MacOSGDBProcesses extends GDBProcesses {
|
||||
|
||||
public MacOSGDBProcesses(DsfSession session) {
|
||||
super(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize(final RequestMonitor requestMonitor) {
|
||||
super.initialize(new RequestMonitor(getExecutor(), requestMonitor) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
doInitialize(requestMonitor);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void doInitialize(RequestMonitor requestMonitor) {
|
||||
// Register this service.
|
||||
register(new String[] { IProcesses.class.getName(),
|
||||
IMIProcesses.class.getName(),
|
||||
MIProcesses.class.getName(),
|
||||
GDBProcesses.class.getName(),
|
||||
MacOSGDBProcesses.class.getName() },
|
||||
new Hashtable<String, String>());
|
||||
|
||||
getSession().addServiceEventListener(this, null);
|
||||
|
||||
requestMonitor.done();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdown(RequestMonitor requestMonitor) {
|
||||
getSession().removeServiceEventListener(this);
|
||||
super.shutdown(requestMonitor);
|
||||
}
|
||||
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatchedMacOS(ISuspendedDMEvent e) {
|
||||
// With Apple-gdb, we flush the command cache because we need
|
||||
// new results from -thread-list-ids
|
||||
// This is because there is no IStartedDMEvent triggered by GDB on Apple-gdb
|
||||
flushCache(null);
|
||||
}
|
||||
}
|
|
@ -13,6 +13,7 @@
|
|||
package org.eclipse.cdt.dsf.gdb.service.macos;
|
||||
|
||||
import org.eclipse.cdt.dsf.debug.service.IExpressions;
|
||||
import org.eclipse.cdt.dsf.debug.service.IProcesses;
|
||||
import org.eclipse.cdt.dsf.debug.service.IRunControl;
|
||||
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
|
||||
import org.eclipse.cdt.dsf.service.DsfSession;
|
||||
|
@ -40,4 +41,9 @@ public class MacOSGdbDebugServicesFactory extends GdbDebugServicesFactory {
|
|||
protected IRunControl createRunControlService(DsfSession session) {
|
||||
return new MacOSGDBRunControl(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IProcesses createProcessesService(DsfSession session) {
|
||||
return new MacOSGDBProcesses(session);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue