mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-12 10:45:37 +02:00
2004-10-19 Alain Magloire
Fix Core Launching * cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java * mi/org/eclipse/cdt/debug/mi/core/CoreProcess.java * mi/org/eclipse/cdt/debug/mi/core/MIInferior.java * src/org/eclipse/cdt/debug/mi/core/MIPlugin.java
This commit is contained in:
parent
75a64c1e16
commit
e25bef1bed
6 changed files with 92 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
|||
2004-10-19 Alain Magloire
|
||||
Fix Core Launching
|
||||
* cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java
|
||||
* mi/org/eclipse/cdt/debug/mi/core/CoreProcess.java
|
||||
* mi/org/eclipse/cdt/debug/mi/core/MIInferior.java
|
||||
* src/org/eclipse/cdt/debug/mi/core/MIPlugin.java
|
||||
|
||||
2004-10-18 Alain Magloire
|
||||
Adjust to changes in CDI
|
||||
* src/org/eclipse/cdt/debug/mi/core/cdi/model/RuntimeOptions.java
|
||||
|
|
|
@ -82,6 +82,6 @@ public class CoreFileConfiguration implements ICDIConfiguration {
|
|||
* @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#terminateSessionOnExit()
|
||||
*/
|
||||
public boolean terminateSessionOnExit() {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDISignal;
|
|||
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint;
|
||||
import org.eclipse.cdt.debug.mi.core.CoreProcess;
|
||||
import org.eclipse.cdt.debug.mi.core.MIException;
|
||||
import org.eclipse.cdt.debug.mi.core.MISession;
|
||||
import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager;
|
||||
|
@ -684,6 +685,9 @@ public class Target implements ICDITarget {
|
|||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#getProcess()
|
||||
*/
|
||||
public Process getProcess() {
|
||||
if (miSession.isCoreSession()) {
|
||||
return new CoreProcess();
|
||||
}
|
||||
return miSession.getMIInferior();
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2002,2003,2004 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
***********************************************************************/
|
||||
package org.eclipse.cdt.debug.mi.core;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
/*
|
||||
* CoreProcess
|
||||
*/
|
||||
public class CoreProcess extends Process {
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Process#exitValue()
|
||||
*/
|
||||
public int exitValue() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Process#waitFor()
|
||||
*/
|
||||
public int waitFor() throws InterruptedException {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Process#destroy()
|
||||
*/
|
||||
public void destroy() {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Process#getErrorStream()
|
||||
*/
|
||||
public InputStream getErrorStream() {
|
||||
return new InputStream() {
|
||||
public int read() throws IOException {
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Process#getInputStream()
|
||||
*/
|
||||
public InputStream getInputStream() {
|
||||
return new InputStream() {
|
||||
public int read() throws IOException {
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Process#getOutputStream()
|
||||
*/
|
||||
public OutputStream getOutputStream() {
|
||||
return new OutputStream() {
|
||||
public void write(int b) throws IOException {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
|
@ -165,7 +165,8 @@ public class MIInferior extends Process {
|
|||
// to kill a disconnected program).
|
||||
// - For Program session:
|
||||
// if the inferior was not terminated.
|
||||
// - For PostMortem(Core): noop
|
||||
// - For PostMortem(Core): send event
|
||||
// else noop
|
||||
if ((session.isAttachSession() && isConnected()) || (session.isProgramSession() && !isTerminated())) {
|
||||
|
||||
CommandFactory factory = session.getCommandFactory();
|
||||
|
@ -175,6 +176,8 @@ public class MIInferior extends Process {
|
|||
session.postCommand(abort);
|
||||
abort.getMIInfo();
|
||||
setTerminated(abort.getToken(), true);
|
||||
} else if (session.isCoreSession()){
|
||||
setTerminated(0, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -232,6 +232,8 @@ public class MIPlugin extends Plugin {
|
|||
MISession session;
|
||||
try {
|
||||
session = createMISession(pgdb, null, MISession.CORE);
|
||||
//@@@ We have to manually set the suspended state when doing post-mortem
|
||||
session.getMIInferior().setSuspended();
|
||||
} catch (MIException e) {
|
||||
pgdb.destroy();
|
||||
throw e;
|
||||
|
|
Loading…
Add table
Reference in a new issue