Rags | 9 Nov 00:24 2004
Picon

Source code for a particular instruction


Hi,

  How to get source code from bytecode?. I tried Utility.codeToString(...) but
it only gives in JVM instructions. I want source code for specific
instruction(s) in the  byte code. Is there any facility to do that without
reverse engineering whole bytecode?. 

Thanx in advance.

Bye  
Nick Hynes | 9 Nov 02:52 2004

RE: Source code for a particular instruction

Try using DJ java decompiler. It's free, and works well.

  _____  

Peace Software
Nick Hynes
Software Architect 
Strategy Research & Architecture
Peace House
100 Symonds St
Auckland, NZ
Tel. 9-373-0400  ext. 5001
Fax. 9-373-0401
  _____  

This message contains CONFIDENTIAL INFORMATION intended solely for the
use of the addressee(s) named above. Any review, disclosure,
distribution, copying or use of the information by others is strictly
prohibited. If you have received this message in error, please advise
the sender by immediate reply and delete the original message.  

|||-----Original Message-----
|||From: Rags [mailto:raghul <at> gmail.com]
|||Sent: Tuesday, 9 November 2004 12:24 p.m.
|||To: bcel-user <at> jakarta.apache.org
|||Subject: Source code for a particular instruction
|||
|||
|||Hi,
|||
(Continue reading)

SianLun Lau | 9 Nov 08:35 2004
Picon

Re: Source code for a particular instruction

On Mon, 8 Nov 2004 23:24:21 +0000 (UTC)
Rags <raghul <at> gmail.com> wrote:

>   How to get source code from bytecode?. I tried
>   Utility.codeToString(...) but
> it only gives in JVM instructions. I want source code for specific
> instruction(s) in the  byte code. Is there any facility to do that
> without reverse engineering whole bytecode?. 

i use jad for getting the source code out of the class files.

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

SL
Raghu L | 9 Nov 11:10 2004
Picon

Re: Source code for a particular instruction

Hi, 

U guys miss understood my question.  I want with out using any
decompiler(they use reverse enginnering I guess).  I have source code
and bytecode I want to know for a specific instruction in the
instruction list the corresponding source code. For example we can
know the line number of a instruction in the source code by using
LinenumberTable. Can we get exact position in the line which has
produced the instruction.

For example

if( (a!=0 && b> 40) || (b!=a && c==d) && (c>=78 || d<40))
    //*   8   14:iload_1         
    //*   9   15:ifeq            24
    //*  10   18:iload_2         
    //*  11   19:bipush          40
    //*  12   21:icmpgt          48
    //*  13   24:iload_2         
    //*  14   25:iload_1         
    //*  15   26:icmpeq          59
    //*  16   29:iload_3         
    //*  17   30:iload           4
    //*  18   32:icmpne          59
    //*  19   35:iload_3         
    //*  20   36:bipush          78
    //*  21   38:icmpge          48
    //*  22   41:iload           4
    //*  23   43:bipush          40
    //*  24   45:icmpge          59    
(Continue reading)

Paul McLachlan | 9 Nov 18:01 2004

RE: Source code for a particular instruction

This information is not available in a standard javac compiled class file.

I'm not sure if it's even available via JSR-45, which would be the only other possible place you could look:
http://www.jcp.org/en/jsr/detail?id=45

But, I have seem some custom JSP vendors (I forget who, it was one of the niche players), back before the days
of JSR-45, with a debugger that used information like this - I'm sure they were compiling it in themselves
though, not to a standard.

Bad news, sorry.

- Paul

-----Original Message-----
From: Raghu L [mailto:raghul <at> gmail.com] 
Sent: Tuesday, November 09, 2004 2:11 AM
To: BCEL Users List
Subject: Re: Source code for a particular instruction

Hi, 

U guys miss understood my question.  I want with out using any
decompiler(they use reverse enginnering I guess).  I have source code
and bytecode I want to know for a specific instruction in the
instruction list the corresponding source code. For example we can
know the line number of a instruction in the source code by using
LinenumberTable. Can we get exact position in the line which has
produced the instruction.

For example
(Continue reading)


Gmane