src/jdk.jdwp.agent/share/native/libjdwp/inStream.c

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 162,171 **** --- 162,189 ---- jdouble val = 0; (void)readBytes(stream, &val, sizeof(val)); return JAVA_TO_HOST_DOUBLE(val); } + /* + * Read a module from the stream. The ID used in the wire protocol + * is converted to a reference which is returned. The reference is + * global and strong, but it should *not* be deleted by the caller + * since it is freed when this stream is destroyed. + */ + jobject + inStream_readModuleRef(JNIEnv *env, PacketInputStream *stream) + { + jobject ref = inStream_readObjectRef(env, stream); + if (ref == NULL && stream->error == JDWP_ERROR(INVALID_OBJECT)) { + stream->error = JDWP_ERROR(INVALID_MODULE); + return NULL; + } + + return ref; + } + /* * Read an object from the stream. The ID used in the wire protocol * is converted to a reference which is returned. The reference is * global and strong, but it should *not* be deleted by the caller * since it is freed when this stream is destroyed.