Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

18
LINES

< > BotCompany Repo | #1030295 // printClassByteCode - prints class info and code for all methods

JavaX fragment (include) [tags: use-pretranspiled]

Uses 679K of libraries. Click here for Pure Java version (9620L/53K).

svoid printClassByteCode(O o) {
  if (o == null) ret;
  JavaClass clz = classToBCEL(o);
  if (clz == null)
    ret with print("No class data found for " + _getClass(o));
    
  print("PRINTING BYTE CODE FOR: "
    + assertEquals("Disassembled class name",
      className(o), clz.getClassName()));
  print();
  print(tabToSingleSpace(str(clz)));
  print();
  for (org.apache.bcel.classfile.Method method : clz.getMethods()) {
     printWithNLBeforeAndAfter(method);
     printWithIndent(tabToSingleSpace(str(method.getCode())));
  }
  print();
}

download  show line numbers  debug dex  old transpilations   

Travelled to 5 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030295
Snippet name: printClassByteCode - prints class info and code for all methods
Eternal ID of this version: #1030295/10
Text MD5: 8558bfd9b4d5bbf6ff335e65ee33359c
Transpilation MD5: 08b4fab87997d52706391c1c085ecd6b
Author: stefan
Category: javax / byte code
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-08-12 07:12:30
Source code size: 562 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 231 / 368
Version history: 9 change(s)
Referenced in: [show references]