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 162688 Details for
Bug 279390
[fiximprove][debug]: Cannot debug static variables when running debugger
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
additional patch
classloader.patch (text/plain), 3.58 KB, created by
Darin Wright
on 2010-03-22 12:17:15 EDT
(
hide
)
Description:
additional patch
Filename:
MIME Type:
Creator:
Darin Wright
Created:
2010-03-22 12:17:15 EDT
Size:
3.58 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.debug >Index: eval/org/eclipse/jdt/internal/debug/eval/ast/engine/AbstractRuntimeContext.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/AbstractRuntimeContext.java,v >retrieving revision 1.8 >diff -u -r1.8 AbstractRuntimeContext.java >--- eval/org/eclipse/jdt/internal/debug/eval/ast/engine/AbstractRuntimeContext.java 22 Mar 2010 15:18:50 -0000 1.8 >+++ eval/org/eclipse/jdt/internal/debug/eval/ast/engine/AbstractRuntimeContext.java 22 Mar 2010 16:15:29 -0000 >@@ -16,6 +16,7 @@ > import org.eclipse.jdt.core.IJavaProject; > import org.eclipse.jdt.debug.core.IJavaClassObject; > import org.eclipse.jdt.debug.core.IJavaClassType; >+import org.eclipse.jdt.debug.core.IJavaFieldVariable; > import org.eclipse.jdt.debug.core.IJavaObject; > import org.eclipse.jdt.debug.core.IJavaType; > import org.eclipse.jdt.debug.core.IJavaValue; >@@ -102,7 +103,14 @@ > protected IJavaClassObject classForName(String qualifiedName, IJavaObject loader) throws CoreException { > IJavaType[] types = getVM().getJavaTypes(qualifiedName); > if (types != null && types.length > 0) { >- return ((IJavaClassType)types[0]).getClassObject(); >+ // find the one with the right class loader >+ for (int i = 0; i < types.length; i++) { >+ IJavaClassType type = (IJavaClassType) types[i]; >+ IJavaObject cloader = type.getClassLoaderObject(); >+ if (isCompatibleLoader(loader, cloader)) { >+ return type.getClassObject(); >+ } >+ } > } > IJavaValue loaderArg = loader; > if (loader == null) { >@@ -142,4 +150,59 @@ > public IJavaProject getProject() { > return fProject; > } >+ >+ /** >+ * Returns whether the class loaded by the <code>otherLoader</code> is compatible >+ * with the receiver's class loader. To be compatible, the other's loader must >+ * be the same or a parent of the receiver's loader. >+ * >+ * @param recLoader class loader of receiver >+ * @param otherLoader class loader of other class >+ * @return whether compatible >+ */ >+ private boolean isCompatibleLoader(IJavaObject recLoader, IJavaObject otherLoader) throws CoreException { >+ if (recLoader == null || otherLoader == null) { >+ // if either class is a bootstrap loader, then they are compatible since all loaders >+ // stem from the bootstrap loader >+ return true; >+ } >+ if (recLoader.equals(otherLoader)) { >+ return true; >+ } >+ // check parent loaders >+ IJavaObject parent = getParentLoader(recLoader); >+ while (parent != null) { >+ if (parent.equals(otherLoader)) { >+ return true; >+ } >+ parent = getParentLoader(parent); >+ } >+ return false; >+ } >+ >+ /** >+ * Returns the parent class loader of the given class loader object or <code>null</code> >+ * if none. >+ * >+ * @param loader class loader object >+ * @return parent class loader or <code>null</code> >+ * @throws CoreException >+ */ >+ private IJavaObject getParentLoader(IJavaObject loader) throws CoreException { >+ // to avoid message send, first check for 'parent' field >+ IJavaFieldVariable field = loader.getField("parent", false); //$NON-NLS-1$ >+ if (field != null) { >+ IJavaValue value = (IJavaValue)field.getValue(); >+ if (value.isNull()) { >+ return null; >+ } >+ return (IJavaObject)value; >+ } >+ IJavaValue result = loader.sendMessage("getParent", "()Ljava/lang/ClassLoader;", null, getThread(), false); //$NON-NLS-1$ //$NON-NLS-2$ >+ if (result.isNull()) { >+ return null; >+ } >+ return (IJavaObject)result; >+ } > } >+
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 279390
:
162678
| 162688 |
162695