hotspot/src/share/vm/prims/jvmtiEnv.cpp
changeset 13201 69f157caabcc
parent 13195 be27e1b6a4b9
child 13728 882756847a04
equal deleted inserted replaced
13200:7b506e7b406e 13201:69f157caabcc
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
  2539     klassOop k = java_lang_Class::as_klassOop(k_mirror);
  2539     klassOop k = java_lang_Class::as_klassOop(k_mirror);
  2540     NULL_CHECK(k, JVMTI_ERROR_INVALID_CLASS);
  2540     NULL_CHECK(k, JVMTI_ERROR_INVALID_CLASS);
  2541     if (!Klass::cast(k)->oop_is_instance()) {
  2541     if (!Klass::cast(k)->oop_is_instance()) {
  2542       return JVMTI_ERROR_ABSENT_INFORMATION;
  2542       return JVMTI_ERROR_ABSENT_INFORMATION;
  2543     }
  2543     }
  2544     Symbol* sdeOop = instanceKlass::cast(k)->source_debug_extension();
  2544     char* sde = instanceKlass::cast(k)->source_debug_extension();
  2545     NULL_CHECK(sdeOop, JVMTI_ERROR_ABSENT_INFORMATION);
  2545     NULL_CHECK(sde, JVMTI_ERROR_ABSENT_INFORMATION);
  2546 
  2546 
  2547     {
  2547     {
  2548       JavaThread* current_thread  = JavaThread::current();
  2548       *source_debug_extension_ptr = (char *) jvmtiMalloc(strlen(sde)+1);
  2549       ResourceMark rm(current_thread);
  2549       strcpy(*source_debug_extension_ptr, sde);
  2550       const char* sdecp = (const char*) sdeOop->as_C_string();
       
  2551       *source_debug_extension_ptr = (char *) jvmtiMalloc(strlen(sdecp)+1);
       
  2552       strcpy(*source_debug_extension_ptr, sdecp);
       
  2553     }
  2550     }
  2554   }
  2551   }
  2555 
  2552 
  2556   return JVMTI_ERROR_NONE;
  2553   return JVMTI_ERROR_NONE;
  2557 } /* end GetSourceDebugExtension */
  2554 } /* end GetSourceDebugExtension */