1 |
/* ReferenceTypeCommandSet.java -- lass to implement the ReferenceType |
/* ReferenceTypeCommandSet.java -- class to implement the ReferenceType |
2 |
Command Set |
Command Set |
3 |
Copyright (C) 2005 Free Software Foundation |
Copyright (C) 2005 Free Software Foundation |
4 |
|
|
36 |
obligated to do so. If you do not wish to do so, delete this |
obligated to do so. If you do not wish to do so, delete this |
37 |
exception statement from your version. */ |
exception statement from your version. */ |
38 |
|
|
39 |
|
|
40 |
package gnu.classpath.jdwp.processor; |
package gnu.classpath.jdwp.processor; |
41 |
|
|
42 |
import gnu.classpath.jdwp.IVirtualMachine; |
import gnu.classpath.jdwp.IVirtualMachine; |
126 |
break; |
break; |
127 |
default: |
default: |
128 |
throw new NotImplementedException("Command " + command + |
throw new NotImplementedException("Command " + command + |
129 |
" not found in String Reference Command Set."); |
" not found in ReferenceType Command Set."); |
130 |
} |
} |
131 |
} |
} |
132 |
catch (IOException ex) |
catch (IOException ex) |
219 |
// We don't actually need the clazz to get the field but we might as |
// We don't actually need the clazz to get the field but we might as |
220 |
// well check that the debugger got it right |
// well check that the debugger got it right |
221 |
if (fieldClazz.isAssignableFrom(clazz)) |
if (fieldClazz.isAssignableFrom(clazz)) |
222 |
Value.writeStaticValueFromField(os, field); |
{ |
223 |
|
try |
224 |
|
{ |
225 |
|
field.setAccessible(true); // Might be a private field |
226 |
|
Object value = field.get(null); |
227 |
|
Value.writeTaggedValue(os, value); |
228 |
|
} |
229 |
|
catch (IllegalArgumentException ex) |
230 |
|
{ |
231 |
|
// I suppose this would best qualify as an invalid field then |
232 |
|
throw new InvalidFieldException(ex); |
233 |
|
} |
234 |
|
catch (IllegalAccessException ex) |
235 |
|
{ |
236 |
|
// Since we set it as accessible this really shouldn't happen |
237 |
|
throw new JdwpInternalErrorException(ex); |
238 |
|
} |
239 |
|
} |
240 |
else |
else |
241 |
throw new InvalidFieldException(fieldId.getId()); |
throw new InvalidFieldException(fieldId.getId()); |
242 |
} |
} |