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 166326 Details for
Bug 310711
NPE getting stackframe while quickly stepping
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
preliminary patch
310711.txt (text/plain), 6.88 KB, created by
Simon Kaegi
on 2010-04-28 10:45:45 EDT
(
hide
)
Description:
preliminary patch
Filename:
MIME Type:
Creator:
Simon Kaegi
Created:
2010-04-28 10:45:45 EDT
Size:
6.88 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.jsdt.debug.core >Index: src/org/eclipse/wst/jsdt/debug/internal/core/model/JavaScriptThread.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jsdt/plugins/org.eclipse.wst.jsdt.debug.core/src/org/eclipse/wst/jsdt/debug/internal/core/model/JavaScriptThread.java,v >retrieving revision 1.19 >diff -u -r1.19 JavaScriptThread.java >--- src/org/eclipse/wst/jsdt/debug/internal/core/model/JavaScriptThread.java 27 Apr 2010 20:22:07 -0000 1.19 >+++ src/org/eclipse/wst/jsdt/debug/internal/core/model/JavaScriptThread.java 28 Apr 2010 14:44:16 -0000 >@@ -100,6 +100,7 @@ > try { > if(request != null) { > deleteRequest(this, request); >+ request = null; > } > resumeUnderlyingThread(); > fireResumeEvent(DebugEvent.CLIENT_REQUEST); >@@ -136,13 +137,16 @@ > void stepEnd(IJavaScriptEventListener listener, StepEvent event) { > ThreadReference threadReference = event.thread(); > if (threadReference == thread) { >+ synchronized(JavaScriptThread.this) { > pendingstep = null; > markSuspended(); > fireSuspendEvent(DebugEvent.STEP_END); >+ > if(request == event.request()) { > deleteRequest(listener, event.request()); > request = null; > } >+ } > } > } > >@@ -225,7 +229,7 @@ > /** > * @return the status text for the thread > */ >- private String statusText() { >+ private synchronized String statusText() { > switch(state) { > case SUSPENDED: { > if(this.breakpoints.size() > 0) { >@@ -289,7 +293,7 @@ > * > * @see org.eclipse.debug.core.model.IThread#getBreakpoints() > */ >- public IBreakpoint[] getBreakpoints() { >+ public synchronized IBreakpoint[] getBreakpoints() { > if (this.breakpoints.isEmpty()) { > return NO_BREAKPOINTS; > } >@@ -319,8 +323,8 @@ > * > * @see org.eclipse.debug.core.model.IThread#getStackFrames() > */ >- public IStackFrame[] getStackFrames() throws DebugException { >- if (!isSuspended()) { >+ public synchronized IStackFrame[] getStackFrames() throws DebugException { >+ if (!isSuspended() || !thread.isSuspended()) { > return NO_STACK_FRAMES; > } > if (this.frames == null) { >@@ -605,10 +609,8 @@ > * @param breakpoint > * @return if the breakpoint added removed an existing entry > */ >- public boolean addBreakpoint(IJavaScriptBreakpoint breakpoint) { >- synchronized (this.breakpoints) { >- return this.breakpoints.add(breakpoint); >- } >+ public synchronized boolean addBreakpoint(IJavaScriptBreakpoint breakpoint) { >+ return breakpoints.add(breakpoint); > } > > /** >@@ -617,16 +619,16 @@ > * @param breakpoint > * @return if the breakpoint was removed > */ >- public boolean removeBreakpoint(IJavaScriptBreakpoint breakpoint) { >- synchronized (this.breakpoints) { >- return this.breakpoints.remove(breakpoint); >- } >+ public synchronized boolean removeBreakpoint(IJavaScriptBreakpoint breakpoint) { >+ return breakpoints.remove(breakpoint); > } > > /** > * Sets the state of the thread to {@link #SUSPENDED} > */ > synchronized void markSuspended() { >+ if (! thread.isSuspended()) >+ System.err.println("Warning: model thread marked suspended when underlything thread is not suspended"); //$NON-NLS-1$ > this.state = SUSPENDED; > } > >@@ -651,7 +653,7 @@ > * > * @see org.eclipse.debug.core.model.IStep#canStepInto() > */ >- public boolean canStepInto() { >+ public synchronized boolean canStepInto() { > return canStep() || atScriptLoadBreakpoint(); > } > >@@ -689,7 +691,7 @@ > /** > * @return <code>true</code> if a step is allowed > */ >- boolean canStep() { >+ synchronized boolean canStep() { > try { > return isSuspended() && !isStepping() && getTopStackFrame() != null; > } >@@ -713,7 +715,9 @@ > * > * @see org.eclipse.debug.core.model.IStep#stepInto() > */ >- public void stepInto() throws DebugException { >+ public synchronized void stepInto() throws DebugException { >+ if (!canStepInto()) >+ System.err.println("Warning: StepInto called on model thread when it canStepInto is false"); //$NON-NLS-1$ > StepHandler handler = new StepHandler(); > handler.step(StepRequest.STEP_INTO, DebugEvent.STEP_INTO); > } >@@ -723,7 +727,9 @@ > * > * @see org.eclipse.debug.core.model.IStep#stepOver() > */ >- public void stepOver() throws DebugException { >+ public synchronized void stepOver() throws DebugException { >+ if (!canStepOver()) >+ System.err.println("Warning: stepOver called on model thread when it canStepOver is false"); //$NON-NLS-1$ > StepHandler handler = new StepHandler(); > handler.step(StepRequest.STEP_OVER, DebugEvent.STEP_OVER); > } >@@ -733,7 +739,9 @@ > * > * @see org.eclipse.debug.core.model.IStep#stepReturn() > */ >- public void stepReturn() throws DebugException { >+ public synchronized void stepReturn() throws DebugException { >+ if (!canStepReturn()) >+ System.err.println("Warning: stepReturn called on model thread when it canStepReturn is false"); //$NON-NLS-1$ > StepHandler handler = new StepHandler(); > handler.step(StepRequest.STEP_OUT, DebugEvent.STEP_RETURN); > } >#P org.eclipse.wst.jsdt.debug.rhino >Index: src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/ThreadReferenceImpl.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jsdt/plugins/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/ThreadReferenceImpl.java,v >retrieving revision 1.11 >diff -u -r1.11 ThreadReferenceImpl.java >--- src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/ThreadReferenceImpl.java 26 Apr 2010 21:14:38 -0000 1.11 >+++ src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/ThreadReferenceImpl.java 28 Apr 2010 14:44:17 -0000 >@@ -192,7 +192,7 @@ > /* (non-Javadoc) > * @see org.eclipse.wst.jsdt.debug.core.jsdi.ThreadReference#suspend() > */ >- public void suspend() { >+ public synchronized void suspend() { > if (status == THREAD_STATUS_ZOMBIE) { > return; > } >Index: src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/EventQueueImpl.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jsdt/plugins/org.eclipse.wst.jsdt.debug.rhino/src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/EventQueueImpl.java,v >retrieving revision 1.11 >diff -u -r1.11 EventQueueImpl.java >--- src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/EventQueueImpl.java 26 Apr 2010 21:14:38 -0000 1.11 >+++ src/org/eclipse/wst/jsdt/debug/internal/rhino/jsdi/event/EventQueueImpl.java 28 Apr 2010 14:44:17 -0000 >@@ -93,6 +93,9 @@ > } > } > } >+ if (!eventSet.isEmpty()) { >+ thread.markSuspended(false); >+ } > } else if (eventName.equals(JSONConstants.BREAK)) { > Long threadId = new Long(((Number) event.getBody().get(JSONConstants.THREAD_ID)).longValue()); > ThreadReferenceImpl thread = vm.getThread(threadId);
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
Actions:
View
|
Diff
Attachments on
bug 310711
: 166326