theUser BL | 8 Feb 00:46
Picon
Gravatar

Problem with visitLineNumber()


Hi!

This is my test-program:
------------------------------------
public class TestProgram {

  int GlobalVaribale1 = 5;
  double GlobalVariable2 = 14.3;

  public static void rectangle(int left, int right, int width, int height) {

    // calculate something

    int result = 5;
    int tmp;

    result=left+width;
    tmp=width+height;

    result *= tmp;

    System.out.println("The result is: " + result); 

  }

}
-------------------------------------
compiled with ASM and decompiled with ASMifier and added some debug-information myself, it looks like

(Continue reading)

Prashant Deva | 28 Jan 03:53
Picon

Request for explicit exception types for 'code size' related exceptions

I have added details for this to the asm bug #316319.


Currently the ClassWriter and MethodWriter classes throw runtime exceptions if the constant pool or code size is too large.
These exceptions are plain RuntimeExceptions with no explicit type.

This is very type unsafe and frankly an ugly way of writing the handlers.

I propose adding explicitly typed Exceptions for both these cases. The exceptions still subclass RuntimeException so they are not checked exceptions and don't change existing callers of these methods.

As mentioned before, I have described the exact changes in the asm bug tracker:


Prashant

--

-- 
You receive this message as a subscriber of the asm <at> ow2.org mailing list.
To unsubscribe: mailto:asm-unsubscribe <at> ow2.org
For general help: mailto:sympa <at> ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Prashant Deva | 14 Jan 22:32
Picon

Patch for frame.merge()

I have submitted a patch for Frame.merge() method to make it more efficient.

The patch is listed in bug 316306.

Prashant

--

-- 
You receive this message as a subscriber of the asm <at> ow2.org mailing list.
To unsubscribe: mailto:asm-unsubscribe <at> ow2.org
For general help: mailto:sympa <at> ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Clement Escoffier | 9 Jan 18:34
Picon
Gravatar

Frames computation with ClassWriter.getCommonSuperClass()

Hi,

I'm in trouble with the getCommonSuperClass. Until recently, my class writer was not computing the
frames, and everything was fine. However with Java 7, I've to compute them, adding the right flag to my
class writer. Unfortunately, in some case, I get a class loading exception. I've figured out from where it
comes : getCommonSuperClass. 

If I understand correctly, in some case ASM needs to know the super class to write the frames.
Unfortunately, it's not always possible in my cases:
* either the classes cannot be loaded (as well as the byte[] of the .class file found)
* the manipulator has no idea where are those classes. 

For example, let's consider a hybrid project using both the Eclipse compiler, writing .class files in
several directories, and an Ant build taking those classes independently and launching some
instrumentation process (using ASM). 

Is there any way to avoid the call to getCommonSuperClass, or is there anyway to turn around the class
dependency ?

Thanks and Regards,

Clement

--

-- 
You receive this message as a subscriber of the asm <at> ow2.org mailing list.
To unsubscribe: mailto:asm-unsubscribe <at> ow2.org
For general help: mailto:sympa <at> ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Prashant Deva | 19 Dec 13:27
Picon

asm 4.0 bug: Getting ClassFormatError: Extra bytes at end of class file

I migrated out codebase to asm 4.0 and now the transformed classes throw the following error while loading after being instrumented

"java.lang.ClassFormatError: Extra bytes at the end of class file"

this wasnt present in asm 3.3. seems like a bug.
Prashant

--

-- 
You receive this message as a subscriber of the asm <at> ow2.org mailing list.
To unsubscribe: mailto:asm-unsubscribe <at> ow2.org
For general help: mailto:sympa <at> ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Prashant Deva | 18 Dec 08:24
Picon

EmptyVisitor replacement in asm 4.0

So now that asm 4.0 doesnt contain an 'empty visitor', whats the best way to implement this.

Do I need to create custom subclasses each for each of the previous visitor 'interfaces' that empty visitor used to use and plug them together?

If so, wouldnt it have been to provide a readymade 'empty <x> visitor' which had all that done, so users of emptyvisitor could upgrade easily

Prashant

--

-- 
You receive this message as a subscriber of the asm <at> ow2.org mailing list.
To unsubscribe: mailto:asm-unsubscribe <at> ow2.org
For general help: mailto:sympa <at> ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Jochen Theodorou | 15 Dec 00:11
Picon

NegativeArraySizeException

Hi,

I get a NegativeArraySizeException in

at org.objectweb.asm.Frame.a(Unknown Source)
at org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source)

has anyone an idea what the reason for this could be? I should mention 
that I overwrite getCommonSuperClass so it might be related to that, but 
how if that is the case?

bye blackdrag

-- 
Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
blog: http://blackdragsview.blogspot.com/
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit http://groovy-lang.org


--

-- 
You receive this message as a subscriber of the asm <at> ow2.org mailing list.
To unsubscribe: mailto:asm-unsubscribe <at> ow2.org
For general help: mailto:sympa <at> ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
althea | 9 Dec 09:59
Picon
Favicon

visitLocalVariable


Hi there,

how do I find the mapping between local variable names in source code and local
variables slots in bytecode by using visitLocalVariable method?

Thanks!

best,
althea

--

-- 
You receive this message as a subscriber of the asm <at> ow2.org mailing list.
To unsubscribe: mailto:asm-unsubscribe <at> ow2.org
For general help: mailto:sympa <at> ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Eric Bruneton | 7 Dec 19:38
Picon
Favicon

Re: Re: Re: Re: Re: ASM 4.0 released

I just released ASM 4.0 to the OW2 Nexus repository, which is synchronized with
the central Maven repository.

Eric

--

-- 
You receive this message as a subscriber of the asm <at> ow2.org mailing list.
To unsubscribe: mailto:asm-unsubscribe <at> ow2.org
For general help: mailto:sympa <at> ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
althea | 6 Dec 19:40
Picon
Favicon

Use of Analyzer<...> and Frame<...>

hi  there,

I have tried to use Analyzer<SourceValue> as the type of a declared variable.
But it does not compile. The java compiler complains that Analyzer cannot take
a parameter. The same happens to Frame.

I looked at the Analyzer class. It is defined as class Analyzer<V extends
Value>, which should require a parameter.  

two issues here:
1) According to definition of Analyzer, Analyzer takes an interface parameter,
isn't it?
2) Yet, the compiler complains it does not take any parameter.

Anyone can help?

thanks,
althea

--

-- 
You receive this message as a subscriber of the asm <at> ow2.org mailing list.
To unsubscribe: mailto:asm-unsubscribe <at> ow2.org
For general help: mailto:sympa <at> ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Jochen Theodorou | 5 Dec 22:22
Picon

sudden class loading in asm

Hi all,

looks like I once again have a problem with asm 4.0

while compiling Groovy I got this message

>   [groovyc] java.lang.RuntimeException: java.lang.ClassNotFoundException: groovy.swing.LookAndFeelHelper
>   [groovyc] 	at org.objectweb.asm.ClassWriter.getCommonSuperClass(Unknown Source)
>   [groovyc] 	at org.objectweb.asm.ClassWriter.a(Unknown Source)
>   [groovyc] 	at org.objectweb.asm.Frame.a(Unknown Source)
>   [groovyc] 	at org.objectweb.asm.Frame.a(Unknown Source)
>   [groovyc] 	at org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source)
>   [groovyc] 	at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:280)

looking at getCommonSuperClass it seems to me that this is related to 
the frame calculation code, which I had to enable because it seems it is 
required by indy. Now my problem is that

ClassLoader classLoader = getClass().getClassLoader();

is not only a poor choice in many many cases, the class in question does 
not even exist yet, thus cannot be found by any class loader. And that 
is because this class is part of the set of classes I am currently 
compiling.

Is my assumption right, that this is because of the frame calculation 
code? And if that is the case, does this mean I will have to create the 
frames myself then? Or is there a more easy way?

bye blackdrag

-- 
Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
blog: http://blackdragsview.blogspot.com/
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit http://groovy-lang.org


--

-- 
You receive this message as a subscriber of the asm <at> ow2.org mailing list.
To unsubscribe: mailto:asm-unsubscribe <at> ow2.org
For general help: mailto:sympa <at> ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws

Gmane