JDK-4990749 : GetBytecodes returns breakpoint bytecodes instead of real bytecodes
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 1.4.0,1.4.2,5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,solaris_7
  • CPU: generic,sparc
  • Submitted: 2004-02-07
  • Updated: 2012-10-01
  • Resolved: 2004-02-23
Related Reports
Duplicate :  
Relates :  
Description
This happens when a bkpt is set.  To see this, run /net/jano.sfbay/export/disk20/serviceability/ws/regressionTestsInWaiting/ByteCodesTest.java

When a breakpoint is set, JVMTI should replace the breakpoint bytecode
with the real bytecode in the bytes that it returns.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta2 FIXED IN: tiger-beta2 INTEGRATED IN: tiger-b40 tiger-beta2 VERIFIED IN: tiger-beta2
14-06-2004

EVALUATION ###@###.### 2004-02-07 JVMTI::GetBytecodes does this: memcpy((*bytecodes_ptr), (unsigned char *)method_oop->code_base(), size); It should then go thru the list of bkpts and store the original bytecode for each into the *bytecodes_ptr array. -- Fixed for b40.
11-06-2004

SUGGESTED FIX ------- jvmtiEnv.cpp ------- 2694c2694,2722 < memcpy((*bytecodes_ptr), (unsigned char *)method_oop->code_base(), size); --- > > // use a BytecodeStream to iterate over the bytecodes. JVM/fast bytecodes > // and the breakpoint bytecode are converted to their original bytecodes. > > HandleMark hm; > methodHandle mh(method_oop); > BytecodeStream bs(mh); > > unsigned char* p = *bytecodes_ptr; > Bytecodes::Code code; > > while ((code = bs.next()) >= 0) { > assert(Bytecodes::is_java_code(code), "sanity check"); > assert(code != Bytecodes::_breakpoint, "sanity check"); > > // bytecode > *p = (unsigned char)code; > > // operands > address bcp = bs.bcp(); > int len = bs.next_bcp() - bcp; > assert(len > 0, "length must be > 0"); > if (len >= 1) { > memcpy(p+1, bcp+1, len-1); > } > > p += len; > } > ###@###.### 2004-02-10
10-02-2004