Changeset 12518
- Timestamp:
- 03/04/10 14:52:35 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/disassemble_class_bytes.java
r12288 r12518 54 54 byte[] bytes = (byte[]) ((JavaObject)arg).getObject(); 55 55 try { 56 File file = File.createTempFile("abcl", null, null);56 File file = File.createTempFile("abcl", ".class", null); 57 57 FileOutputStream out = new FileOutputStream(file); 58 58 out.write(bytes); 59 59 out.close(); 60 60 LispObject disassembler = _DISASSEMBLER_.symbolValue(); 61 StringBuffer command = new StringBuffer(); 61 62 if (disassembler instanceof AbstractString) { 62 StringBuffer sb = new StringBuffer(disassembler.getStringValue());63 sb.append(' ');64 sb.append(file.getPath());65 ShellCommand sc = new ShellCommand(sb.toString(), null, null);66 sc.run();67 file.delete();68 return new SimpleString(sc.getOutput());69 } else 63 command.append(disassembler.getStringValue()); 64 command.append(" "); 65 command.append(file.getPath()); 66 } else if (disassembler instanceof Operator) { 67 Pathname p = Pathname.makePathname(file); 68 LispObject commandResult = disassembler.execute(p); 69 command.append(commandResult.getStringValue()); 70 } else { 70 71 return new SimpleString("No disassembler is available."); 71 } 72 catch (IOException e) { 72 } 73 ShellCommand sc = new ShellCommand(command.toString(), null, null); 74 sc.run(); 75 file.delete(); 76 return new SimpleString(sc.getOutput()); 77 } catch (IOException e) { 73 78 Debug.trace(e); 74 79 }
Note: See TracChangeset
for help on using the changeset viewer.