[hg] main-silver: #222905: Catch unexpected JDWP Error: 13 on Th...

  • From:
  • To:
  • Subject: [hg] main-silver: #222905: Catch unexpected JDWP Error: 13 on Th...
  • Date: Sat, 01 Dec 2012 13:36:49 -0800

changeset d5b9b8d236e1 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/d5b9b8d236e1
description:
        #222905: Catch unexpected JDWP Error: 13 on ThreadReference.resume().

diffstat:

 debugger.jpda/gensrc/org/netbeans/modules/debugger/jpda/jdi/Generate.java    
        |  12 ++++++++++
 
debugger.jpda/src/org/netbeans/modules/debugger/jpda/jdi/ThreadReferenceWrapper.java
 |   8 ++++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diffs (41 lines):

diff --git 
a/debugger.jpda/gensrc/org/netbeans/modules/debugger/jpda/jdi/Generate.java 
b/debugger.jpda/gensrc/org/netbeans/modules/debugger/jpda/jdi/Generate.java
--- 
a/debugger.jpda/gensrc/org/netbeans/modules/debugger/jpda/jdi/Generate.java
+++ 
b/debugger.jpda/gensrc/org/netbeans/modules/debugger/jpda/jdi/Generate.java
@@ -1145,6 +1145,18 @@
                                   "            }\n";
                 return catchNPE;
             }
+            if (methodName.equals("resume")) {
+                String catchJDWPException = "            try {\n"+
+                                            "    "+exec+
+                                            "            } catch 
("+com.sun.jdi.InternalException.class.getName()+" iex) {\n"+
+                                            "                if 
(iex.errorCode() == 13) { // THREAD_NOT_SUSPENDED\n"+
+                                            "                    // Ignore, 
as we're resuming the thread.\n"+
+                                            "                } else {\n"+
+                                            "                    throw iex; 
// re-throw the original\n"+
+                                            "                }\n"+
+                                            "            }\n";
+                return catchJDWPException;
+            }
         }
         if (com.sun.jdi.ReferenceType.class.getName().equals(className) && 
methodName.equals("constantPool")) {
             String catchNPE = "            try {\n"+
diff --git 
a/debugger.jpda/src/org/netbeans/modules/debugger/jpda/jdi/ThreadReferenceWrapper.java
 
b/debugger.jpda/src/org/netbeans/modules/debugger/jpda/jdi/ThreadReferenceWrapper.java
--- 
a/debugger.jpda/src/org/netbeans/modules/debugger/jpda/jdi/ThreadReferenceWrapper.java
+++ 
b/debugger.jpda/src/org/netbeans/modules/debugger/jpda/jdi/ThreadReferenceWrapper.java
@@ -974,7 +974,15 @@
                     new Object[] {a});
         }
         try {
+            try {
             a.resume();
+            } catch (com.sun.jdi.InternalException iex) {
+                if (iex.errorCode() == 13) { // THREAD_NOT_SUSPENDED
+                    // Ignore, as we're resuming the thread.
+                } else {
+                    throw iex; // re-throw the original
+                }
+            }
         } catch (com.sun.jdi.InternalException ex) {
             
org.netbeans.modules.debugger.jpda.JDIExceptionReporter.report(ex);
             throw new 
org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper(ex);

[hg] main-silver: #222905: Catch unexpected JDWP Error: 13 on Th...

mentlicher 12/01/2012

Project Features

About this Project

Debugger was started in November 2009, is owned by tpavek, and has 29 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close