Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 86992 Details for
Bug 215416
CDI/MI framework has hardcoded timeouts for interrupt
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
4_0 patch
cdt_4_0_hardcoded_timeout.txt (text/plain), 5.09 KB, created by
Elena Laskavaia
on 2008-01-15 17:56:58 EST
(
hide
)
Description:
4_0 patch
Filename:
MIME Type:
Creator:
Elena Laskavaia
Created:
2008-01-15 17:56:58 EST
Size:
5.09 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.debug.mi.core >Index: src/org/eclipse/cdt/debug/mi/core/MIProcessAdapter.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIProcessAdapter.java,v >retrieving revision 1.10 >diff -u -r1.10 MIProcessAdapter.java >--- src/org/eclipse/cdt/debug/mi/core/MIProcessAdapter.java 14 Jun 2007 18:32:54 -0000 1.10 >+++ src/org/eclipse/cdt/debug/mi/core/MIProcessAdapter.java 15 Jan 2008 22:44:23 -0000 >@@ -29,6 +29,7 @@ > > Process fGDBProcess; > private static final int ONE_SECOND = 1000; >+ private long commandTimeout; > > public MIProcessAdapter(String[] args, IProgressMonitor monitor) throws IOException { > this(args, 0, monitor); >@@ -36,6 +37,7 @@ > > public MIProcessAdapter(String[] args, int launchTimeout, IProgressMonitor monitor) throws IOException { > fGDBProcess = getGDBProcess(args, launchTimeout, monitor); >+ commandTimeout = MIPlugin.getCommandTimeout(); > } > > /** >@@ -112,16 +114,10 @@ > > public void interrupt(MIInferior inferior) { > if (fGDBProcess instanceof Spawner) { >- Spawner gdbSpawner = (Spawner) fGDBProcess; >- gdbSpawner.interrupt(); >- synchronized (inferior) { >- // Allow (5 secs) for the interrupt to propagate. >- for (int i = 0; inferior.isRunning() && i < 5; i++) { >- try { >- inferior.wait(1000); >- } catch (InterruptedException e) { >- } >- } >+ if (inferior.isRunning()) { >+ Spawner gdbSpawner = (Spawner) fGDBProcess; >+ gdbSpawner.interrupt(); >+ waitForInterrupt(inferior); > } > // If we are still running try to drop the sig to the PID > if (inferior.isRunning() && inferior.getInferiorPID() > 0) { >@@ -132,6 +128,20 @@ > > } > >+ protected boolean waitForInterrupt(MIInferior inferior) { >+ synchronized (inferior) { >+ // Allow MI command timeout for the interrupt to propagate. >+ long maxSec = commandTimeout / ONE_SECOND + 1; >+ for (int i = 0; inferior.isRunning() && i < maxSec; i++) { >+ try { >+ inferior.wait(ONE_SECOND); >+ } catch (InterruptedException e) { >+ } >+ } >+ return inferior.isRunning(); >+ } >+ } >+ > /** > * Send an interrupt to the inferior process. > * >@@ -141,14 +151,7 @@ > if (fGDBProcess instanceof Spawner) { > Spawner gdbSpawner = (Spawner) fGDBProcess; > gdbSpawner.raise(inferior.getInferiorPID(), gdbSpawner.INT); >- synchronized (inferior) { >- for (int i = 0; inferior.isRunning() && i < 5; i++) { >- try { >- inferior.wait(1000); >- } catch (InterruptedException e) { >- } >- } >- } >+ waitForInterrupt(inferior); > } > } > >Index: cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java,v >retrieving revision 1.51.2.2 >diff -u -r1.51.2.2 Target.java >--- cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java 4 Dec 2007 21:31:33 -0000 1.51.2.2 >+++ cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java 15 Jan 2008 22:44:23 -0000 >@@ -36,7 +36,6 @@ > import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction; > import org.eclipse.cdt.debug.core.cdi.model.ICDILineBreakpoint; > import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock; >-import org.eclipse.cdt.debug.core.cdi.model.ICDIMemorySpaceManagement; > import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction; > import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister; > import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterDescriptor; >@@ -631,8 +630,9 @@ > try { > miSession.getMIInferior().interrupt(); > // Wait till the EventManager tell us the go ahead >+ long maxSec = miSession.getCommandTimeout()/1000 + 1; > synchronized (this) { >- for (int i = 0; !suspended && i < 6; i++) { >+ for (int i = 0; !suspended && i < maxSec; i++) { > try { > wait(1000); > } catch (InterruptedException e) { >Index: mi/org/eclipse/cdt/debug/mi/core/MIInferior.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MIInferior.java,v >retrieving revision 1.17 >diff -u -r1.17 MIInferior.java >--- mi/org/eclipse/cdt/debug/mi/core/MIInferior.java 6 Sep 2007 11:56:01 -0000 1.17 >+++ mi/org/eclipse/cdt/debug/mi/core/MIInferior.java 15 Jan 2008 22:44:23 -0000 >@@ -209,9 +209,10 @@ > session.postCommand(interrupt); > // call getMIInfo() even if we discard the value; > interrupt.getMIInfo(); >- // Allow (5 secs) for the interrupt to propagate. >+ // Allow MI command timeout for the interrupt to propagate. >+ long maxSec = session.getCommandTimeout()/1000 + 1; > synchronized(this) { >- for (int i = 0;(state == RUNNING) && i < 5; i++) { >+ for (int i = 0;(state == RUNNING) && i < maxSec; i++) { > try { > wait(1000); > } catch (InterruptedException e) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
bjorn.freeman-benson
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 215416
: 86992