Inspecting the Java bytecodes generated by Jython

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Inspecting the Java bytecodes generated by Jython

Niko Matsakis
Any suggestions for how to go about reading into the Jython code base?

In particular, as a first step, I'm wondering if there is a debug  
mode that will allow me to see the Java byte codes generated for a  
given module and/or fragment of Python code?


thanks,
Niko


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Jython-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-dev
Reply | Threaded
Open this post in threaded view
|

Re: Inspecting the Java bytecodes generated by Jython

fwierzbicki@gmail.com
Are you familiar with javap?  Its not perfect, but its a help.

http://java.sun.com/j2se/1.3/docs/tooldocs/win32/javap.html

On 10/10/05, Niko Matsakis <[hidden email]> wrote:
Any suggestions for how to go about reading into the Jython code base?

In particular, as a first step, I'm wondering if there is a debug
mode that will allow me to see the Java byte codes generated for a
given module and/or fragment of Python code?


thanks,
Niko


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Jython-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-dev

Reply | Threaded
Open this post in threaded view
|

Re: Inspecting the Java bytecodes generated by Jython

Richie Hindle

[Niko]
> I'm wondering if there is a debug
> mode that will allow me to see the Java byte codes generated for a
> given module and/or fragment of Python code?

You could always run the generated x$py.class file through jad:

  http://kpdus.tripod.com/jad.html

to get back the equivalent Java.  There may be a cleaner way to do it, but
it works well.

(Yesterday I made my Python code coverage tool work under Jython by
rewriting a CPython-specific code inspection routine to proc Jad and parse
the resulting Java.  It was surprisingly easy.)

--
Richie Hindle
[hidden email]




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Jython-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-dev
Reply | Threaded
Open this post in threaded view
|

Re: Inspecting the Java bytecodes generated by Jython

Richie Hindle

[Niko]
> I'm wondering if there is a debug
> mode that will allow me to see the Java byte codes generated for a
> given module and/or fragment of Python code?

[me]
> You could always run the generated x$py.class file through jad:
>
>   http://kpdus.tripod.com/jad.html

Sorry - that address should have been: http://www.kpdus.com/jad.html

--
Richie Hindle
[hidden email]




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Jython-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-dev
Reply | Threaded
Open this post in threaded view
|

Re: Inspecting the Java bytecodes generated by Jython

Mark Proctor-4
Bytecode Outline plugin for Eclipse - http://andrei.gmxhome.de/bytecode/index.html

Mark

Richie Hindle wrote:
[Niko]
  
I'm wondering if there is a debug
mode that will allow me to see the Java byte codes generated for a
given module and/or fragment of Python code?
    

[me]
  
You could always run the generated x$py.class file through jad:

  http://kpdus.tripod.com/jad.html
    

Sorry - that address should have been: http://www.kpdus.com/jad.html