[RFA/JDWP] Fix ReferenceType.sourceFile

Kyle Galloway kgallowa@redhat.com
Wed Apr 11 17:17:00 GMT 2007


Kyle Galloway wrote:
> Currently, since it is possible to get null returned from 
> _Jv_GetInterpClasssourceFile if the class in either native of if the 
> information is not available, a call to ReferenceType.sourceFile may 
> cause a NPE in writeString which will crash the communication thread 
> causing the VM to stop responding to commands.  This patch fixes this 
> by checking in VMVirtualMachine::getSourceFile to see if there source 
> file is null, and throwing an AbsentInformationException.  Though 
> there are two possible causes for this in our implementation, the JDWP 
> spec does not distinguish and only allows for an ABSENT_INFORMATION 
> error in this case.
>
> ChangeLog
> 2007-04-11  Kyle Galloway  <kgallowa@redhat.com>
>
>    * gnu/classpath/jdwp/natVMVirtualMachine.cc (getSourceFile): Check
>    for null source file and throw an exception indicating this.
>
> Questions/comments/concerns?
>
> Thanks,
>
> Kyle
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sourcefile.patch
Type: text/x-patch
Size: 621 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20070411/8bbf1ef3/attachment.bin>


More information about the Java-patches mailing list